webdav.php 1023 B

123456789101112131415161718192021222324252627282930313233343536373839
  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 DAV extends Storage {
  10. private $config;
  11. protected function setUp() {
  12. parent::setUp();
  13. $id = $this->getUniqueID();
  14. $this->config = include('files_external/tests/config.php');
  15. if ( ! is_array($this->config) or ! isset($this->config['webdav']) or ! $this->config['webdav']['run']) {
  16. $this->markTestSkipped('WebDAV backend not configured');
  17. }
  18. if (isset($this->config['webdav']['wait'])) {
  19. $this->waitDelay = $this->config['webdav']['wait'];
  20. }
  21. $this->config['webdav']['root'] .= '/' . $id; //make sure we have an new empty folder to work in
  22. $this->instance = new \OC\Files\Storage\DAV($this->config['webdav']);
  23. $this->instance->mkdir('/');
  24. }
  25. protected function tearDown() {
  26. if ($this->instance) {
  27. $this->instance->rmdir('/');
  28. }
  29. parent::tearDown();
  30. }
  31. }