@@ -26,17 +26,17 @@ class ImportMapConfigReaderTest extends TestCase
26
26
protected function setUp (): void
27
27
{
28
28
$ this ->filesystem = new Filesystem ();
29
- if (!file_exists (__DIR__ . '/../Fixtures/importmaps_for_writing ' )) {
30
- $ this ->filesystem ->mkdir (__DIR__ . '/../Fixtures/importmaps_for_writing ' );
29
+ if (!file_exists (__DIR__ . '/../Fixtures/importmaps_for_writing ' )) {
30
+ $ this ->filesystem ->mkdir (__DIR__ . '/../Fixtures/importmaps_for_writing ' );
31
31
}
32
- if (!file_exists (__DIR__ . '/../Fixtures/importmaps_for_writing/assets ' )) {
33
- $ this ->filesystem ->mkdir (__DIR__ . '/../Fixtures/importmaps_for_writing/assets ' );
32
+ if (!file_exists (__DIR__ . '/../Fixtures/importmaps_for_writing/assets ' )) {
33
+ $ this ->filesystem ->mkdir (__DIR__ . '/../Fixtures/importmaps_for_writing/assets ' );
34
34
}
35
35
}
36
36
37
37
protected function tearDown (): void
38
38
{
39
- $ this ->filesystem ->remove (__DIR__ . '/../Fixtures/importmaps_for_writing ' );
39
+ $ this ->filesystem ->remove (__DIR__ . '/../Fixtures/importmaps_for_writing ' );
40
40
}
41
41
42
42
public function testGetEntriesAndWriteEntries ()
@@ -63,7 +63,7 @@ public function testGetEntriesAndWriteEntries()
63
63
],
64
64
];
65
65
EOF ;
66
- file_put_contents (__DIR__ . '/../Fixtures/importmaps_for_writing/importmap.php ' , $ importMap );
66
+ file_put_contents (__DIR__ . '/../Fixtures/importmaps_for_writing/importmap.php ' , $ importMap );
67
67
68
68
$ remotePackageStorage = $ this ->createMock (RemotePackageStorage::class);
69
69
$ remotePackageStorage ->expects ($ this ->any ())
@@ -72,7 +72,7 @@ public function testGetEntriesAndWriteEntries()
72
72
return '/path/to/vendor/ ' .$ packageModuleSpecifier .'. ' .$ type ->value ;
73
73
});
74
74
$ reader = new ImportMapConfigReader (
75
- __DIR__ . '/../Fixtures/importmaps_for_writing/importmap.php ' ,
75
+ __DIR__ . '/../Fixtures/importmaps_for_writing/importmap.php ' ,
76
76
$ remotePackageStorage ,
77
77
);
78
78
$ entries = $ reader ->getEntries ();
@@ -100,24 +100,24 @@ public function testGetEntriesAndWriteEntries()
100
100
$ this ->assertSame ('package/with_file.js ' , $ packageWithFileEntry ->packageModuleSpecifier );
101
101
102
102
// now save the original raw data from importmap.php and delete the file
103
- $ originalImportMapData = (static fn () => include __DIR__ . '/../Fixtures/importmaps_for_writing/importmap.php ' )();
104
- unlink (__DIR__ . '/../Fixtures/importmaps_for_writing/importmap.php ' );
103
+ $ originalImportMapData = (static fn () => include __DIR__ . '/../Fixtures/importmaps_for_writing/importmap.php ' )();
104
+ unlink (__DIR__ . '/../Fixtures/importmaps_for_writing/importmap.php ' );
105
105
// dump the entries back to the file
106
106
$ reader ->writeEntries ($ entries );
107
- $ newImportMapData = (static fn () => include __DIR__ . '/../Fixtures/importmaps_for_writing/importmap.php ' )();
107
+ $ newImportMapData = (static fn () => include __DIR__ . '/../Fixtures/importmaps_for_writing/importmap.php ' )();
108
108
109
109
$ this ->assertSame ($ originalImportMapData , $ newImportMapData );
110
110
}
111
111
112
112
public function testGetRootDirectory ()
113
113
{
114
- $ configReader = new ImportMapConfigReader (__DIR__ . '/../Fixtures/importmap.php ' , $ this ->createMock (RemotePackageStorage::class));
115
- $ this ->assertSame (__DIR__ . '/../Fixtures ' , $ configReader ->getRootDirectory ());
114
+ $ configReader = new ImportMapConfigReader (__DIR__ . '/../Fixtures/importmap.php ' , $ this ->createMock (RemotePackageStorage::class));
115
+ $ this ->assertSame (__DIR__ . '/../Fixtures ' , $ configReader ->getRootDirectory ());
116
116
}
117
117
118
118
public function testFindRootImportMapEntry ()
119
119
{
120
- $ configReader = new ImportMapConfigReader (__DIR__ .'/../fixtures /importmap.php ' , $ this ->createMock (RemotePackageStorage::class));
120
+ $ configReader = new ImportMapConfigReader (__DIR__ .'/../Fixtures /importmap.php ' , $ this ->createMock (RemotePackageStorage::class));
121
121
$ entry = $ configReader ->findRootImportMapEntry ('file2 ' );
122
122
$ this ->assertSame ('file2 ' , $ entry ->importName );
123
123
$ this ->assertSame ('file2.js ' , $ entry ->path );
0 commit comments