File tree Expand file tree Collapse file tree 1 file changed +25
-0
lines changed
src/Symfony/Component/Filesystem/Tests 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()
1201
1201
$ this ->assertStringEqualsFile ($ filename , 'bar ' );
1202
1202
}
1203
1203
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
+
1204
1229
/**
1205
1230
* @group legacy
1206
1231
*/
You can’t perform that action at this time.
0 commit comments