mirror of
https://github.com/espocrm/espocrm.git
synced 2026-06-29 15:36:07 +00:00
Unit test for copy() of FileManager
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
["File.json"]
|
||||
@@ -0,0 +1,3 @@
|
||||
<?php
|
||||
|
||||
//File.php
|
||||
@@ -0,0 +1 @@
|
||||
Tester.txt
|
||||
Reference in New Issue
Block a user