@@ -48,10 +48,9 @@ public function testAssetsAreCompiled()
48
48
$ this ->filesystem ->remove ($ targetBuildDir );
49
49
}
50
50
// put old "built" versions to make sure the system skips using these
51
- $ this ->filesystem ->mkdir ($ targetBuildDir );
52
- file_put_contents ($ targetBuildDir .'/manifest.json ' , '{} ' );
53
- file_put_contents ($ targetBuildDir .'/importmap.json ' , '{} ' );
54
- file_put_contents ($ targetBuildDir .'/entrypoint.file6.json ' , '[] ' );
51
+ $ this ->filesystem ->dumpFile ($ targetBuildDir .'/manifest.json ' , '{} ' );
52
+ $ this ->filesystem ->dumpFile ($ targetBuildDir .'/importmap.json ' , '{} ' );
53
+ $ this ->filesystem ->dumpFile ($ targetBuildDir .'/entrypoint.file6.json ' , '[] ' );
55
54
56
55
$ command = $ application ->find ('asset-map:compile ' );
57
56
$ tester = new CommandTester ($ command );
@@ -65,7 +64,7 @@ public function testAssetsAreCompiled()
65
64
import '../file4.js';
66
65
console.log('file5.js');
67
66
68
- EOF , file_get_contents ($ targetBuildDir .'/subdir/file5-f4fdc37375c7f5f2629c5659a0579967.js ' ));
67
+ EOF , $ this -> filesystem -> readFile ($ targetBuildDir .'/subdir/file5-f4fdc37375c7f5f2629c5659a0579967.js ' ));
69
68
70
69
$ finder = new Finder ();
71
70
$ finder ->in ($ targetBuildDir )->files ();
@@ -83,10 +82,10 @@ public function testAssetsAreCompiled()
83
82
'vendor/@hotwired/stimulus/stimulus.index.js ' ,
84
83
'vendor/lodash/lodash.index.js ' ,
85
84
'voilà.css ' ,
86
- ], array_keys (json_decode (file_get_contents ($ targetBuildDir .'/manifest.json ' ), true )));
85
+ ], array_keys (json_decode ($ this -> filesystem -> readFile ($ targetBuildDir .'/manifest.json ' ), true )));
87
86
88
87
$ this ->assertFileExists ($ targetBuildDir .'/importmap.json ' );
89
- $ actualImportMap = json_decode (file_get_contents ($ targetBuildDir .'/importmap.json ' ), true );
88
+ $ actualImportMap = json_decode ($ this -> filesystem -> readFile ($ targetBuildDir .'/importmap.json ' ), true );
90
89
$ this ->assertSame ([
91
90
'@hotwired/stimulus ' , // in importmap
92
91
'lodash ' , // in importmap
@@ -102,7 +101,7 @@ public function testAssetsAreCompiled()
102
101
$ this ->assertSame ('js ' , $ actualImportMap ['@hotwired/stimulus ' ]['type ' ]);
103
102
104
103
$ this ->assertFileExists ($ targetBuildDir .'/entrypoint.file6.json ' );
105
- $ entrypointData = json_decode (file_get_contents ($ targetBuildDir .'/entrypoint.file6.json ' ), true );
104
+ $ entrypointData = json_decode ($ this -> filesystem -> readFile ($ targetBuildDir .'/entrypoint.file6.json ' ), true );
106
105
$ this ->assertSame ([
107
106
'/assets/subdir/file5.js ' ,
108
107
'/assets/file4.js ' ,
0 commit comments