CopyDirectoryTest.php 816 B

12345678910111213141516171819202122232425262728293031323334353637
  1. <?php
  2. /**
  3. * SPDX-FileCopyrightText: 2019-2024 Nextcloud GmbH and Nextcloud contributors
  4. * SPDX-FileCopyrightText: 2016 ownCloud, Inc.
  5. * SPDX-License-Identifier: AGPL-3.0-only
  6. */
  7. namespace Test\Files\Storage;
  8. use OC\Files\Storage\Temporary;
  9. class StorageNoRecursiveCopy extends Temporary {
  10. public function copy($path1, $path2) {
  11. if ($this->is_dir($path1)) {
  12. return false;
  13. }
  14. return copy($this->getSourcePath($path1), $this->getSourcePath($path2));
  15. }
  16. }
  17. class CopyDirectoryStorage extends StorageNoRecursiveCopy {
  18. use \OC\Files\Storage\PolyFill\CopyDirectory;
  19. }
  20. /**
  21. * Class CopyDirectoryTest
  22. *
  23. * @group DB
  24. *
  25. * @package Test\Files\Storage
  26. */
  27. class CopyDirectoryTest extends Storage {
  28. protected function setUp(): void {
  29. parent::setUp();
  30. $this->instance = new CopyDirectoryStorage([]);
  31. }
  32. }