CopyDirectoryTest.php 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <?php
  2. /**
  3. * @author Robin Appelman <icewind@owncloud.com>
  4. *
  5. * @copyright Copyright (c) 2015, ownCloud, Inc.
  6. * @license AGPL-3.0
  7. *
  8. * This code is free software: you can redistribute it and/or modify
  9. * it under the terms of the GNU Affero General Public License, version 3,
  10. * as published by the Free Software Foundation.
  11. *
  12. * This program is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU Affero General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU Affero General Public License, version 3,
  18. * along with this program. If not, see <http://www.gnu.org/licenses/>
  19. *
  20. */
  21. namespace Test\Files\Storage;
  22. use OC\Files\Storage\Temporary;
  23. class StorageNoRecursiveCopy extends Temporary {
  24. public function copy($path1, $path2) {
  25. if ($this->is_dir($path1)) {
  26. return false;
  27. }
  28. return copy($this->getSourcePath($path1), $this->getSourcePath($path2));
  29. }
  30. }
  31. class CopyDirectoryStorage extends StorageNoRecursiveCopy {
  32. use \OC\Files\Storage\PolyFill\CopyDirectory;
  33. }
  34. /**
  35. * Class CopyDirectoryTest
  36. *
  37. * @group DB
  38. *
  39. * @package Test\Files\Storage
  40. */
  41. class CopyDirectoryTest extends Storage {
  42. protected function setUp(): void {
  43. parent::setUp();
  44. $this->instance = new CopyDirectoryStorage([]);
  45. }
  46. }