@@ -26,7 +26,7 @@ public function testCopyCreatesNewFile()
2626 $ this ->filesystem ->copy ($ sourceFilePath , $ targetFilePath );
2727
2828 $ this ->assertFileExists ($ targetFilePath );
29- $ this ->assertEquals ( 'SOURCE FILE ' , file_get_contents ( $ targetFilePath ) );
29+ $ this ->assertStringEqualsFile ( $ targetFilePath , 'SOURCE FILE ' );
3030 }
3131
3232 /**
@@ -73,7 +73,7 @@ public function testCopyOverridesExistingFileIfModified()
7373 $ this ->filesystem ->copy ($ sourceFilePath , $ targetFilePath );
7474
7575 $ this ->assertFileExists ($ targetFilePath );
76- $ this ->assertEquals ( 'SOURCE FILE ' , file_get_contents ( $ targetFilePath ) );
76+ $ this ->assertStringEqualsFile ( $ targetFilePath , 'SOURCE FILE ' );
7777 }
7878
7979 public function testCopyDoesNotOverrideExistingFileByDefault ()
@@ -92,7 +92,7 @@ public function testCopyDoesNotOverrideExistingFileByDefault()
9292 $ this ->filesystem ->copy ($ sourceFilePath , $ targetFilePath );
9393
9494 $ this ->assertFileExists ($ targetFilePath );
95- $ this ->assertEquals ( 'TARGET FILE ' , file_get_contents ( $ targetFilePath ) );
95+ $ this ->assertStringEqualsFile ( $ targetFilePath , 'TARGET FILE ' );
9696 }
9797
9898 public function testCopyOverridesExistingFileIfForced ()
@@ -111,7 +111,7 @@ public function testCopyOverridesExistingFileIfForced()
111111 $ this ->filesystem ->copy ($ sourceFilePath , $ targetFilePath , true );
112112
113113 $ this ->assertFileExists ($ targetFilePath );
114- $ this ->assertEquals ( 'SOURCE FILE ' , file_get_contents ( $ targetFilePath ) );
114+ $ this ->assertStringEqualsFile ( $ targetFilePath , 'SOURCE FILE ' );
115115 }
116116
117117 /**
@@ -153,7 +153,7 @@ public function testCopyCreatesTargetDirectoryIfItDoesNotExist()
153153
154154 $ this ->assertTrue (is_dir ($ targetFileDirectory ));
155155 $ this ->assertFileExists ($ targetFilePath );
156- $ this ->assertEquals ( 'SOURCE FILE ' , file_get_contents ( $ targetFilePath ) );
156+ $ this ->assertStringEqualsFile ( $ targetFilePath , 'SOURCE FILE ' );
157157 }
158158
159159 /**
@@ -840,9 +840,9 @@ public function testRemoveSymlink()
840840
841841 $ this ->filesystem ->remove ($ link );
842842
843- $ this ->assertTrue (! is_link ($ link ));
844- $ this ->assertTrue (! is_file ($ link ));
845- $ this ->assertTrue (! is_dir ($ link ));
843+ $ this ->assertFalse ( is_link ($ link ));
844+ $ this ->assertFalse ( is_file ($ link ));
845+ $ this ->assertFalse ( is_dir ($ link ));
846846 }
847847
848848 public function testSymlinkIsOverwrittenIfPointsToDifferentTarget ()
@@ -1474,7 +1474,7 @@ public function testDumpFile()
14741474
14751475 $ this ->filesystem ->dumpFile ($ filename , 'bar ' );
14761476 $ this ->assertFileExists ($ filename );
1477- $ this ->assertSame ( 'bar ' , file_get_contents ( $ filename ) );
1477+ $ this ->assertStringEqualsFile ( $ filename , 'bar ' );
14781478
14791479 // skip mode check on Windows
14801480 if ('\\' !== DIRECTORY_SEPARATOR ) {
@@ -1491,7 +1491,7 @@ public function testDumpFileOverwritesAnExistingFile()
14911491 $ this ->filesystem ->dumpFile ($ filename , 'bar ' );
14921492
14931493 $ this ->assertFileExists ($ filename );
1494- $ this ->assertSame ( 'bar ' , file_get_contents ( $ filename ) );
1494+ $ this ->assertStringEqualsFile ( $ filename , 'bar ' );
14951495 }
14961496
14971497 public function testDumpFileWithFileScheme ()
@@ -1506,7 +1506,7 @@ public function testDumpFileWithFileScheme()
15061506 $ this ->filesystem ->dumpFile ($ filename , 'bar ' );
15071507
15081508 $ this ->assertFileExists ($ filename );
1509- $ this ->assertSame ( 'bar ' , file_get_contents ( $ filename ) );
1509+ $ this ->assertStringEqualsFile ( $ filename , 'bar ' );
15101510 }
15111511
15121512 public function testDumpFileWithZlibScheme ()
@@ -1518,7 +1518,7 @@ public function testDumpFileWithZlibScheme()
15181518
15191519 // Zlib stat uses file:// wrapper so remove scheme
15201520 $ this ->assertFileExists (str_replace ($ scheme , '' , $ filename ));
1521- $ this ->assertSame ( 'bar ' , file_get_contents ( $ filename ) );
1521+ $ this ->assertStringEqualsFile ( $ filename , 'bar ' );
15221522 }
15231523
15241524 public function testAppendToFile ()
@@ -1535,7 +1535,7 @@ public function testAppendToFile()
15351535 $ this ->filesystem ->appendToFile ($ filename , 'bar ' );
15361536
15371537 $ this ->assertFileExists ($ filename );
1538- $ this ->assertSame ( 'foobar ' , file_get_contents ( $ filename ) );
1538+ $ this ->assertStringEqualsFile ( $ filename , 'foobar ' );
15391539
15401540 // skip mode check on Windows
15411541 if ('\\' !== DIRECTORY_SEPARATOR ) {
@@ -1557,7 +1557,7 @@ public function testAppendToFileWithScheme()
15571557 $ this ->filesystem ->appendToFile ($ filename , 'bar ' );
15581558
15591559 $ this ->assertFileExists ($ filename );
1560- $ this ->assertSame ( 'foobar ' , file_get_contents ( $ filename ) );
1560+ $ this ->assertStringEqualsFile ( $ filename , 'foobar ' );
15611561 }
15621562
15631563 public function testAppendToFileWithZlibScheme ()
@@ -1567,12 +1567,12 @@ public function testAppendToFileWithZlibScheme()
15671567 $ this ->filesystem ->dumpFile ($ filename , 'foo ' );
15681568
15691569 // Zlib stat uses file:// wrapper so remove it
1570- $ this ->assertSame ( ' foo ' , file_get_contents ( str_replace ($ scheme , '' , $ filename )) );
1570+ $ this ->assertStringEqualsFile ( str_replace ($ scheme , '' , $ filename ), ' foo ' );
15711571
15721572 $ this ->filesystem ->appendToFile ($ filename , 'bar ' );
15731573
15741574 $ this ->assertFileExists ($ filename );
1575- $ this ->assertSame ( 'foobar ' , file_get_contents ( $ filename ) );
1575+ $ this ->assertStringEqualsFile ( $ filename , 'foobar ' );
15761576 }
15771577
15781578 public function testAppendToFileCreateTheFileIfNotExists ()
@@ -1593,7 +1593,7 @@ public function testAppendToFileCreateTheFileIfNotExists()
15931593 }
15941594
15951595 $ this ->assertFileExists ($ filename );
1596- $ this ->assertSame ( 'bar ' , file_get_contents ( $ filename ) );
1596+ $ this ->assertStringEqualsFile ( $ filename , 'bar ' );
15971597 }
15981598
15991599 public function testDumpKeepsExistingPermissionsWhenOverwritingAnExistingFile ()
0 commit comments