File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed
src/Symfony/Component/Filesystem/Tests Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -441,6 +441,28 @@ public function providePathsForMakePathRelative()
441441 return $ paths ;
442442 }
443443
444+ public function testMirrorCopiesFilesAndDirectoriesRecursively ()
445+ {
446+ $ sourcePath = $ this ->workspace .DIRECTORY_SEPARATOR .'source ' .DIRECTORY_SEPARATOR ;
447+ $ directory = $ sourcePath .'directory ' .DIRECTORY_SEPARATOR ;
448+ $ file1 = $ directory .'file1 ' ;
449+ $ file2 = $ sourcePath .'file2 ' ;
450+
451+ mkdir ($ sourcePath );
452+ mkdir ($ directory );
453+ file_put_contents ($ file1 , 'FILE1 ' );
454+ file_put_contents ($ file2 , 'FILE2 ' );
455+
456+ $ targetPath = $ this ->workspace .DIRECTORY_SEPARATOR .'target ' .DIRECTORY_SEPARATOR ;
457+
458+ $ this ->filesystem ->mirror ($ sourcePath , $ targetPath );
459+
460+ $ this ->assertTrue (is_dir ($ targetPath ));
461+ $ this ->assertTrue (is_dir ($ targetPath .'directory ' ));
462+ $ this ->assertFileEquals ($ file1 , $ targetPath .'directory ' .DIRECTORY_SEPARATOR .'file1 ' );
463+ $ this ->assertFileEquals ($ file2 , $ targetPath .'file2 ' );
464+ }
465+
444466 /**
445467 * @dataProvider providePathsForIsAbsolutePath
446468 */
You can’t perform that action at this time.
0 commit comments