PageRenderTime 61ms CodeModel.GetById 29ms RepoModel.GetById 1ms app.codeStats 0ms

/apps/files_external/tests/dropbox.php

https://github.com/sezuan/core
PHP | 29 lines | 19 code | 4 blank | 6 comment | 2 complexity | 8f1a4bab59f7dc08e31bfd86b813509f MD5 | raw file
Possible License(s): AGPL-3.0, AGPL-1.0, MPL-2.0-no-copyleft-exception
  1. <?php
  2. /**
  3. * Copyright (c) 2012 Robin Appelman <icewind@owncloud.com>
  4. * This file is licensed under the Affero General Public License version 3 or
  5. * later.
  6. * See the COPYING-README file.
  7. */
  8. namespace Test\Files\Storage;
  9. class Dropbox extends Storage {
  10. private $config;
  11. public function setUp() {
  12. $id = uniqid();
  13. $this->config = include('files_external/tests/config.php');
  14. if ( ! is_array($this->config) or ! isset($this->config['dropbox']) or ! $this->config['dropbox']['run']) {
  15. $this->markTestSkipped('Dropbox backend not configured');
  16. }
  17. $this->config['dropbox']['root'] .= '/' . $id; //make sure we have an new empty folder to work in
  18. $this->instance = new \OC\Files\Storage\Dropbox($this->config['dropbox']);
  19. }
  20. public function tearDown() {
  21. if ($this->instance) {
  22. $this->instance->unlink('/');
  23. }
  24. }
  25. }