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 @@ -1201,6 +1201,31 @@ public function testDumpFile()
12011201 $ this ->assertStringEqualsFile ($ filename , 'bar ' );
12021202 }
12031203
1204+ public function testDumpFileWithArray ()
1205+ {
1206+ $ filename = $ this ->workspace .\DIRECTORY_SEPARATOR .'foo ' .\DIRECTORY_SEPARATOR .'baz.txt ' ;
1207+
1208+ $ this ->filesystem ->dumpFile ($ filename , array ('bar ' ));
1209+
1210+ $ this ->assertFileExists ($ filename );
1211+ $ this ->assertStringEqualsFile ($ filename , 'bar ' );
1212+ }
1213+
1214+ public function testDumpFileWithResource ()
1215+ {
1216+ $ filename = $ this ->workspace .\DIRECTORY_SEPARATOR .'foo ' .\DIRECTORY_SEPARATOR .'baz.txt ' ;
1217+
1218+ $ resource = fopen ('php://memory ' , 'rw ' );
1219+ fwrite ($ resource , 'bar ' );
1220+ fseek ($ resource , 0 );
1221+
1222+ $ this ->filesystem ->dumpFile ($ filename , $ resource );
1223+
1224+ fclose ($ resource );
1225+ $ this ->assertFileExists ($ filename );
1226+ $ this ->assertStringEqualsFile ($ filename , 'bar ' );
1227+ }
1228+
12041229 /**
12051230 * @group legacy
12061231 */
You can’t perform that action at this time.
0 commit comments