@@ -1605,6 +1605,21 @@ public function testDumpFileOverwritesAnExistingFile()
1605
1605
$ this ->assertStringEqualsFile ($ filename , 'bar ' );
1606
1606
}
1607
1607
1608
+ public function testDumpFileFollowsSymlink ()
1609
+ {
1610
+ $ filename = $ this ->workspace .\DIRECTORY_SEPARATOR .'foo.txt ' ;
1611
+ file_put_contents ($ filename , 'FOO BAR ' );
1612
+ $ linkname = $ this ->workspace .\DIRECTORY_SEPARATOR .'bar.txt ' ;
1613
+ $ this ->filesystem ->symlink ($ filename , $ linkname );
1614
+
1615
+ $ this ->filesystem ->dumpFile ($ linkname , 'bar ' );
1616
+
1617
+ $ this ->assertFileExists ($ filename );
1618
+ $ this ->assertFileExists ($ linkname );
1619
+ $ this ->assertStringEqualsFile ($ filename , 'bar ' );
1620
+ $ this ->assertStringEqualsFile ($ linkname , 'bar ' );
1621
+ }
1622
+
1608
1623
public function testDumpFileWithFileScheme ()
1609
1624
{
1610
1625
$ scheme = 'file:// ' ;
@@ -1678,6 +1693,21 @@ public function testAppendToFileWithResource()
1678
1693
}
1679
1694
}
1680
1695
1696
+ public function testAppendToFileFollowsSymlink ()
1697
+ {
1698
+ $ filename = $ this ->workspace .\DIRECTORY_SEPARATOR .'foo.txt ' ;
1699
+ file_put_contents ($ filename , 'foo ' );
1700
+ $ linkname = $ this ->workspace .\DIRECTORY_SEPARATOR .'bar.txt ' ;
1701
+ $ this ->filesystem ->symlink ($ filename , $ linkname );
1702
+
1703
+ $ this ->filesystem ->appendToFile ($ linkname , 'bar ' );
1704
+
1705
+ $ this ->assertFileExists ($ filename );
1706
+ $ this ->assertFileExists ($ linkname );
1707
+ $ this ->assertStringEqualsFile ($ filename , 'foobar ' );
1708
+ $ this ->assertStringEqualsFile ($ linkname , 'foobar ' );
1709
+ }
1710
+
1681
1711
public function testAppendToFileWithScheme ()
1682
1712
{
1683
1713
$ scheme = 'file:// ' ;
0 commit comments