@@ -1609,22 +1609,27 @@ public function testDumpFileFollowsSymlink()
1609
1609
{
1610
1610
$ filename = $ this ->workspace .\DIRECTORY_SEPARATOR .'foo.txt ' ;
1611
1611
file_put_contents ($ filename , 'FOO BAR ' );
1612
- $ linkname = $ this ->workspace .\DIRECTORY_SEPARATOR .'bar.txt ' ;
1613
- $ this ->filesystem ->symlink ($ filename , $ linkname );
1612
+ $ linknameA = $ this ->workspace .\DIRECTORY_SEPARATOR .'bar.txt ' ;
1613
+ $ linknameB = $ this ->workspace .\DIRECTORY_SEPARATOR .'baz.txt ' ;
1614
+ $ this ->filesystem ->symlink ($ filename , $ linknameA );
1615
+ $ this ->filesystem ->symlink ($ linknameA , $ linknameB );
1614
1616
1615
- $ this ->filesystem ->dumpFile ($ linkname , 'bar ' );
1617
+ $ this ->filesystem ->dumpFile ($ linknameB , 'bar ' );
1616
1618
1617
1619
$ this ->assertFileExists ($ filename );
1618
- $ this ->assertFileExists ($ linkname );
1620
+ $ this ->assertFileExists ($ linknameA );
1621
+ $ this ->assertFileExists ($ linknameB );
1619
1622
$ this ->assertStringEqualsFile ($ filename , 'bar ' );
1620
- $ this ->assertStringEqualsFile ($ linkname , 'bar ' );
1623
+ $ this ->assertStringEqualsFile ($ linknameA , 'bar ' );
1624
+ $ this ->assertStringEqualsFile ($ linknameB , 'bar ' );
1621
1625
1622
1626
$ this ->filesystem ->remove ($ filename );
1623
- $ this ->filesystem ->dumpFile ($ linkname , 'baz ' );
1627
+ $ this ->filesystem ->dumpFile ($ linknameB , 'baz ' );
1624
1628
1625
1629
$ this ->assertFileExists ($ filename );
1626
1630
$ this ->assertStringEqualsFile ($ filename , 'baz ' );
1627
- $ this ->assertStringEqualsFile ($ linkname , 'baz ' );
1631
+ $ this ->assertStringEqualsFile ($ linknameA , 'baz ' );
1632
+ $ this ->assertStringEqualsFile ($ linknameB , 'baz ' );
1628
1633
}
1629
1634
1630
1635
public function testDumpFileWithFileScheme ()
@@ -1704,22 +1709,29 @@ public function testAppendToFileFollowsSymlink()
1704
1709
{
1705
1710
$ filename = $ this ->workspace .\DIRECTORY_SEPARATOR .'foo.txt ' ;
1706
1711
file_put_contents ($ filename , 'foo ' );
1707
- $ linkname = $ this ->workspace .\DIRECTORY_SEPARATOR .'bar.txt ' ;
1708
- $ this ->filesystem ->symlink ($ filename , $ linkname );
1712
+ $ linknameA = $ this ->workspace .\DIRECTORY_SEPARATOR .'bar.txt ' ;
1713
+ $ linknameB = $ this ->workspace .\DIRECTORY_SEPARATOR .'baz.txt ' ;
1714
+ $ this ->filesystem ->symlink ($ filename , $ linknameA );
1715
+ $ this ->filesystem ->symlink ($ linknameA , $ linknameB );
1709
1716
1710
- $ this ->filesystem ->appendToFile ($ linkname , 'bar ' );
1717
+ $ this ->filesystem ->appendToFile ($ linknameA , 'bar ' );
1718
+ $ this ->filesystem ->appendToFile ($ linknameB , 'baz ' );
1711
1719
1712
1720
$ this ->assertFileExists ($ filename );
1713
- $ this ->assertFileExists ($ linkname );
1714
- $ this ->assertStringEqualsFile ($ filename , 'foobar ' );
1715
- $ this ->assertStringEqualsFile ($ linkname , 'foobar ' );
1721
+ $ this ->assertFileExists ($ linknameA );
1722
+ $ this ->assertFileExists ($ linknameB );
1723
+ $ this ->assertStringEqualsFile ($ filename , 'foobarbaz ' );
1724
+ $ this ->assertStringEqualsFile ($ linknameA , 'foobarbaz ' );
1725
+ $ this ->assertStringEqualsFile ($ linknameB , 'foobarbaz ' );
1716
1726
1717
1727
$ this ->filesystem ->remove ($ filename );
1718
- $ this ->filesystem ->appendToFile ($ linkname , 'baz ' );
1728
+ $ this ->filesystem ->appendToFile ($ linknameB , 'foo ' );
1729
+ $ this ->filesystem ->appendToFile ($ linknameA , 'bar ' );
1719
1730
1720
1731
$ this ->assertFileExists ($ filename );
1721
- $ this ->assertStringEqualsFile ($ filename , 'baz ' );
1722
- $ this ->assertStringEqualsFile ($ linkname , 'baz ' );
1732
+ $ this ->assertStringEqualsFile ($ filename , 'foobar ' );
1733
+ $ this ->assertStringEqualsFile ($ linknameA , 'foobar ' );
1734
+ $ this ->assertStringEqualsFile ($ linknameB , 'foobar ' );
1723
1735
}
1724
1736
1725
1737
public function testAppendToFileWithScheme ()
0 commit comments