owncloud.php 875 B

1234567891011121314151617181920212223242526272829303132
  1. <?php
  2. /**
  3. * Copyright (c) 2013 Vincent Petry <pvince81@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 OwnCloud 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['owncloud']) or ! $this->config['owncloud']['run']) {
  15. $this->markTestSkipped('ownCloud backend not configured');
  16. }
  17. $this->config['owncloud']['root'] .= '/' . $id; //make sure we have an new empty folder to work in
  18. $this->instance = new \OC\Files\Storage\OwnCloud($this->config['owncloud']);
  19. $this->instance->mkdir('/');
  20. }
  21. public function tearDown() {
  22. if ($this->instance) {
  23. $this->instance->rmdir('/');
  24. }
  25. }
  26. }