You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

OwncloudTest.php 1.8KB

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