OwncloudTest.php 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <?php
  2. /**
  3. * SPDX-FileCopyrightText: 2017-2024 Nextcloud GmbH and Nextcloud contributors
  4. * SPDX-FileCopyrightText: 2016 ownCloud, Inc.
  5. * SPDX-License-Identifier: AGPL-3.0-only
  6. */
  7. namespace OCA\Files_External\Tests\Storage;
  8. use OCA\Files_External\Lib\Storage\OwnCloud;
  9. /**
  10. * Class OwnCloudTest
  11. *
  12. * @group DB
  13. *
  14. * @package OCA\Files_External\Tests\Storage
  15. */
  16. class OwncloudTest extends \Test\Files\Storage\Storage {
  17. private $config;
  18. protected function setUp(): void {
  19. parent::setUp();
  20. $id = $this->getUniqueID();
  21. $this->config = include('files_external/tests/config.php');
  22. if (! is_array($this->config) or ! isset($this->config['owncloud']) or ! $this->config['owncloud']['run']) {
  23. $this->markTestSkipped('Nextcloud backend not configured');
  24. }
  25. $this->config['owncloud']['root'] .= '/' . $id; //make sure we have an new empty folder to work in
  26. $this->instance = new OwnCloud($this->config['owncloud']);
  27. $this->instance->mkdir('/');
  28. }
  29. protected function tearDown(): void {
  30. if ($this->instance) {
  31. $this->instance->rmdir('/');
  32. }
  33. parent::tearDown();
  34. }
  35. }