diff --git a/src/Symfony/Component/Filesystem/Tests/FilesystemTest.php b/src/Symfony/Component/Filesystem/Tests/FilesystemTest.php index 8f2bde2e36..186b2ef364 100644 --- a/src/Symfony/Component/Filesystem/Tests/FilesystemTest.php +++ b/src/Symfony/Component/Filesystem/Tests/FilesystemTest.php @@ -1348,6 +1348,22 @@ class FilesystemTest extends FilesystemTestCase $this->assertFileNotExists($targetPath.'target'); } + public function testMirrorFromSubdirectoryInToParentDirectory() + { + $targetPath = $this->workspace.\DIRECTORY_SEPARATOR.'foo'.\DIRECTORY_SEPARATOR; + $sourcePath = $targetPath.'bar'.\DIRECTORY_SEPARATOR; + $file1 = $sourcePath.'file1'; + $file2 = $sourcePath.'file2'; + + $this->filesystem->mkdir($sourcePath); + file_put_contents($file1, 'FILE1'); + file_put_contents($file2, 'FILE2'); + + $this->filesystem->mirror($sourcePath, $targetPath); + + $this->assertFileEquals($file1, $targetPath.'file1'); + } + /** * @dataProvider providePathsForIsAbsolutePath */