File tree Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -1483,6 +1483,31 @@ public function testDumpFile()
14831483 }
14841484 }
14851485
1486+ public function testDumpFileWithArray ()
1487+ {
1488+ $ filename = $ this ->workspace .\DIRECTORY_SEPARATOR .'foo ' .\DIRECTORY_SEPARATOR .'baz.txt ' ;
1489+
1490+ $ this ->filesystem ->dumpFile ($ filename , array ('bar ' ));
1491+
1492+ $ this ->assertFileExists ($ filename );
1493+ $ this ->assertStringEqualsFile ($ filename , 'bar ' );
1494+ }
1495+
1496+ public function testDumpFileWithResource ()
1497+ {
1498+ $ filename = $ this ->workspace .\DIRECTORY_SEPARATOR .'foo ' .\DIRECTORY_SEPARATOR .'baz.txt ' ;
1499+
1500+ $ resource = fopen ('php://memory ' , 'rw ' );
1501+ fwrite ($ resource , 'bar ' );
1502+ fseek ($ resource , 0 );
1503+
1504+ $ this ->filesystem ->dumpFile ($ filename , $ resource );
1505+
1506+ fclose ($ resource );
1507+ $ this ->assertFileExists ($ filename );
1508+ $ this ->assertStringEqualsFile ($ filename , 'bar ' );
1509+ }
1510+
14861511 public function testDumpFileOverwritesAnExistingFile ()
14871512 {
14881513 $ filename = $ this ->workspace .\DIRECTORY_SEPARATOR .'foo.txt ' ;
You can’t perform that action at this time.
0 commit comments