99use Becklyn \AssetsBundle \File \Type \GenericFile ;
1010use Becklyn \AssetsBundle \Namespaces \NamespaceRegistry ;
1111use PHPUnit \Framework \TestCase ;
12+ use Symfony \Component \DependencyInjection \ServiceLocator ;
1213
1314class FileLoaderTest extends TestCase
1415{
@@ -36,7 +37,7 @@ protected function setUp () : void
3637 "bundles " => "{$ this ->fixtures }/public/bundles " ,
3738 ]);
3839
39- $ fileTypes = new FileTypeRegistry (new GenericFile ());
40+ $ fileTypes = new FileTypeRegistry (new GenericFile (), new ServiceLocator ([]) );
4041
4142 $ this ->loader = new FileLoader ($ this ->namespaceRegistry , $ fileTypes );
4243 }
@@ -100,9 +101,9 @@ public function testCustomProcessorCalledInDev () : void
100101 ->method ("processForDev " )
101102 ->willReturnArgument (2 );
102103
103- $ fileTypes = new FileTypeRegistry (new GenericFile (), [
104- "css " => $ testFileType ,
105- ]);
104+ $ fileTypes = new FileTypeRegistry (new GenericFile (), new ServiceLocator ( [
105+ "css " => function () use ( $ testFileType) { return $ testFileType ; } ,
106+ ])) ;
106107
107108 $ loader = new FileLoader ($ this ->namespaceRegistry , $ fileTypes );
108109 $ loader ->loadFile (new Asset ("bundles " , "test/css/app.css " ), FileLoader::MODE_DEV );
@@ -123,9 +124,9 @@ public function testCustomProcessorCalledInProd () : void
123124 ->method ("processForProd " )
124125 ->willReturnArgument (1 );
125126
126- $ fileTypes = new FileTypeRegistry (new GenericFile (), [
127- "css " => $ testFileType ,
128- ]);
127+ $ fileTypes = new FileTypeRegistry (new GenericFile (), new ServiceLocator ( [
128+ "css " => function () use ( $ testFileType) { return $ testFileType ; } ,
129+ ])) ;
129130
130131 $ loader = new FileLoader ($ this ->namespaceRegistry , $ fileTypes );
131132 $ loader ->loadFile (new Asset ("bundles " , "test/css/app.css " ), FileLoader::MODE_PROD );
@@ -145,9 +146,9 @@ public function testCustomProcessorNotCalledInUntouched () : void
145146 ->expects (self ::never ())
146147 ->method ("processForProd " );
147148
148- $ fileTypes = new FileTypeRegistry (new GenericFile (), [
149- "css " => $ testFileType ,
150- ]);
149+ $ fileTypes = new FileTypeRegistry (new GenericFile (), new ServiceLocator ( [
150+ "css " => function () use ( $ testFileType) { return $ testFileType ; } ,
151+ ])) ;
151152
152153 $ loader = new FileLoader ($ this ->namespaceRegistry , $ fileTypes );
153154 $ loader ->loadFile (new Asset ("bundles " , "test/css/app.css " ), FileLoader::MODE_UNTOUCHED );
@@ -176,9 +177,9 @@ public function testFallbackType () : void
176177 ->method ("processForProd " )
177178 ->willReturnArgument (1 );
178179
179- $ fileTypes = new FileTypeRegistry ($ genericFileType , [
180- "css " => $ testFileType ,
181- ]);
180+ $ fileTypes = new FileTypeRegistry ($ genericFileType , new ServiceLocator ( [
181+ "css " => function () use ( $ testFileType) { return $ testFileType ; } ,
182+ ])) ;
182183
183184 $ loader = new FileLoader ($ this ->namespaceRegistry , $ fileTypes );
184185 $ loader ->loadFile (new Asset ("bundles " , "test/js/test.js " ), FileLoader::MODE_PROD );
0 commit comments