2015-07-03 07:44:03 -04:00
|
|
|
<?php
|
2025-06-30 09:04:05 -04:00
|
|
|
|
2015-07-03 07:44:03 -04:00
|
|
|
/**
|
2024-05-10 09:09:14 -04:00
|
|
|
* SPDX-FileCopyrightText: 2019-2024 Nextcloud GmbH and Nextcloud contributors
|
|
|
|
|
* SPDX-FileCopyrightText: 2016 ownCloud, Inc.
|
|
|
|
|
* SPDX-License-Identifier: AGPL-3.0-only
|
2015-07-03 07:44:03 -04:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
namespace Test\Files\Storage;
|
|
|
|
|
|
2025-06-12 12:31:58 -04:00
|
|
|
use OC\Files\Storage\PolyFill\CopyDirectory;
|
2015-07-03 07:44:03 -04:00
|
|
|
use OC\Files\Storage\Temporary;
|
|
|
|
|
|
|
|
|
|
class StorageNoRecursiveCopy extends Temporary {
|
2024-10-01 10:12:30 -04:00
|
|
|
public function copy(string $source, string $target): bool {
|
|
|
|
|
if ($this->is_dir($source)) {
|
2015-07-03 07:44:03 -04:00
|
|
|
return false;
|
|
|
|
|
}
|
2024-10-01 10:12:30 -04:00
|
|
|
return copy($this->getSourcePath($source), $this->getSourcePath($target));
|
2015-07-03 07:44:03 -04:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
class CopyDirectoryStorage extends StorageNoRecursiveCopy {
|
2025-06-12 12:31:58 -04:00
|
|
|
use CopyDirectory;
|
2015-07-03 07:44:03 -04:00
|
|
|
}
|
|
|
|
|
|
2015-11-20 05:27:11 -05:00
|
|
|
/**
|
2016-05-20 09:38:20 -04:00
|
|
|
* Class CopyDirectoryTest
|
2015-11-20 05:27:11 -05:00
|
|
|
*
|
|
|
|
|
*
|
|
|
|
|
* @package Test\Files\Storage
|
|
|
|
|
*/
|
2025-10-20 19:52:40 -04:00
|
|
|
#[\PHPUnit\Framework\Attributes\Group('DB')]
|
2016-05-20 09:38:20 -04:00
|
|
|
class CopyDirectoryTest extends Storage {
|
2019-11-21 10:40:38 -05:00
|
|
|
protected function setUp(): void {
|
2015-07-03 07:44:03 -04:00
|
|
|
parent::setUp();
|
|
|
|
|
$this->instance = new CopyDirectoryStorage([]);
|
|
|
|
|
}
|
|
|
|
|
}
|