WebdavTest.php 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. <?php
  2. /**
  3. * @copyright Copyright (c) 2016, ownCloud, Inc.
  4. *
  5. * @author Joas Schilling <coding@schilljs.com>
  6. * @author Morris Jobke <hey@morrisjobke.de>
  7. * @author Robin Appelman <robin@icewind.nl>
  8. * @author Robin McCorkell <robin@mccorkell.me.uk>
  9. * @author Thomas Müller <thomas.mueller@tmit.eu>
  10. * @author Vincent Petry <pvince81@owncloud.com>
  11. *
  12. * @license AGPL-3.0
  13. *
  14. * This code is free software: you can redistribute it and/or modify
  15. * it under the terms of the GNU Affero General Public License, version 3,
  16. * as published by the Free Software Foundation.
  17. *
  18. * This program is distributed in the hope that it will be useful,
  19. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  20. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  21. * GNU Affero General Public License for more details.
  22. *
  23. * You should have received a copy of the GNU Affero General Public License, version 3,
  24. * along with this program. If not, see <http://www.gnu.org/licenses/>
  25. *
  26. */
  27. namespace OCA\Files_External\Tests\Storage;
  28. use \OC\Files\Storage\DAV;
  29. /**
  30. * Class WebdavTest
  31. *
  32. * @group DB
  33. *
  34. * @package OCA\Files_External\Tests\Storage
  35. */
  36. class WebdavTest extends \Test\Files\Storage\Storage {
  37. protected function setUp() {
  38. parent::setUp();
  39. $id = $this->getUniqueID();
  40. $config = include('files_external/tests/config.webdav.php');
  41. if ( ! is_array($config) or !$config['run']) {
  42. $this->markTestSkipped('WebDAV backend not configured');
  43. }
  44. if (isset($config['wait'])) {
  45. $this->waitDelay = $config['wait'];
  46. }
  47. $config['root'] .= '/' . $id; //make sure we have an new empty folder to work in
  48. $this->instance = new DAV($config);
  49. $this->instance->mkdir('/');
  50. }
  51. protected function tearDown() {
  52. if ($this->instance) {
  53. $this->instance->rmdir('/');
  54. }
  55. parent::tearDown();
  56. }
  57. }