diff --git a/tests/unit/Espo/Core/Utils/File/ManagerTest.php b/tests/unit/Espo/Core/Utils/File/ManagerTest.php index 9503d9225b..38a1c90a75 100644 --- a/tests/unit/Espo/Core/Utils/File/ManagerTest.php +++ b/tests/unit/Espo/Core/Utils/File/ManagerTest.php @@ -413,5 +413,23 @@ class ManagerTest extends \PHPUnit\Framework\TestCase { $this->assertEquals($result, $this->reflection->invokeMethod('getExistsPath', array($input)) ); } -} + public function testCopyTestCase1() + { + $path = 'tests/unit/testData/FileManager/copy/testCase1'; + $cachePath = $this->cachePath . '/copy/testCase1'; + + $expectedResult = [ + 'custom/Espo/Custom/Modules/ExtensionTest/File.json', + 'custom/Espo/Custom/Modules/ExtensionTest/File.php', + 'custom/Espo/Custom/Modules/TestModule/SubFolder/Tester.txt', + ]; + + $result = $this->object->copy($path, $cachePath, true); + + if ($result) { + $this->assertEquals($expectedResult, $this->object->getFileList($cachePath, true, '', true, true)); + $this->object->removeInDir($cachePath); + } + } +} \ No newline at end of file diff --git a/tests/unit/testData/FileManager/copy/testCase1/custom/Espo/Custom/Modules/ExtensionTest/File.json b/tests/unit/testData/FileManager/copy/testCase1/custom/Espo/Custom/Modules/ExtensionTest/File.json new file mode 100755 index 0000000000..28b2dec2eb --- /dev/null +++ b/tests/unit/testData/FileManager/copy/testCase1/custom/Espo/Custom/Modules/ExtensionTest/File.json @@ -0,0 +1 @@ +["File.json"] \ No newline at end of file diff --git a/tests/unit/testData/FileManager/copy/testCase1/custom/Espo/Custom/Modules/ExtensionTest/File.php b/tests/unit/testData/FileManager/copy/testCase1/custom/Espo/Custom/Modules/ExtensionTest/File.php new file mode 100755 index 0000000000..86301b56eb --- /dev/null +++ b/tests/unit/testData/FileManager/copy/testCase1/custom/Espo/Custom/Modules/ExtensionTest/File.php @@ -0,0 +1,3 @@ +