Skip to content

Commit 70adda0

Browse files
committed
add test to avoid regressions
1 parent 44fa9ca commit 70adda0

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

Tests/FilesystemTest.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1348,6 +1348,22 @@ public function testMirrorContentsWithSameNameAsSourceOrTargetWithDeleteOption()
13481348
$this->assertFileNotExists($targetPath.'target');
13491349
}
13501350

1351+
public function testMirrorFromSubdirectoryInToParentDirectory()
1352+
{
1353+
$targetPath = $this->workspace.\DIRECTORY_SEPARATOR.'foo'.\DIRECTORY_SEPARATOR;
1354+
$sourcePath = $targetPath.'bar'.\DIRECTORY_SEPARATOR;
1355+
$file1 = $sourcePath.'file1';
1356+
$file2 = $sourcePath.'file2';
1357+
1358+
$this->filesystem->mkdir($sourcePath);
1359+
file_put_contents($file1, 'FILE1');
1360+
file_put_contents($file2, 'FILE2');
1361+
1362+
$this->filesystem->mirror($sourcePath, $targetPath);
1363+
1364+
$this->assertFileEquals($file1, $targetPath.'file1');
1365+
}
1366+
13511367
/**
13521368
* @dataProvider providePathsForIsAbsolutePath
13531369
*/

0 commit comments

Comments
 (0)