3939use Symfony \Component \DependencyInjection \Tests \Fixtures \PrototypeAsAlias \AliasBarInterface ;
4040use Symfony \Component \DependencyInjection \Tests \Fixtures \PrototypeAsAlias \AliasFooInterface ;
4141use Symfony \Component \DependencyInjection \Tests \Fixtures \PrototypeAsAlias \WithAsAlias ;
42+ use Symfony \Component \DependencyInjection \Tests \Fixtures \PrototypeAsAlias \WithAsAliasDevEnv ;
4243use Symfony \Component \DependencyInjection \Tests \Fixtures \PrototypeAsAlias \WithAsAliasIdMultipleInterface ;
4344use Symfony \Component \DependencyInjection \Tests \Fixtures \PrototypeAsAlias \WithAsAliasInterface ;
4445use Symfony \Component \DependencyInjection \Tests \Fixtures \PrototypeAsAlias \WithAsAliasMultiple ;
46+ use Symfony \Component \DependencyInjection \Tests \Fixtures \PrototypeAsAlias \WithAsAliasProdEnv ;
4547use Symfony \Component \DependencyInjection \Tests \Fixtures \Utils \NotAService ;
4648
4749class FileLoaderTest extends TestCase
@@ -174,7 +176,8 @@ public function testRegisterClassesWithExcludeAsArray()
174176 $ loader ->registerClasses (
175177 new Definition (),
176178 'Symfony\Component\DependencyInjection\Tests\Fixtures\Prototype \\' ,
177- 'Prototype/* ' , [
179+ 'Prototype/* ' ,
180+ [
178181 'Prototype/%sub_dir% ' ,
179182 'Prototype/OtherDir/AnotherSub/DeeperBaz.php ' ,
180183 ]
@@ -348,11 +351,12 @@ public function testRegisterThrowsWithBothWhenAndNotWhenAttribute()
348351
349352 /**
350353 * @dataProvider provideResourcesWithAsAliasAttributes
354+ * @group debug
351355 */
352- public function testRegisterClassesWithAsAlias (string $ resource , array $ expectedAliases )
356+ public function testRegisterClassesWithAsAlias (string $ resource , array $ expectedAliases, ? string $ env = null )
353357 {
354358 $ container = new ContainerBuilder ();
355- $ loader = new TestFileLoader ($ container , new FileLocator (self ::$ fixturesPath .'/Fixtures ' ));
359+ $ loader = new TestFileLoader ($ container , new FileLocator (self ::$ fixturesPath .'/Fixtures ' ), $ env );
356360 $ loader ->registerClasses (
357361 (new Definition ())->setAutoconfigured (true ),
358362 'Symfony\Component\DependencyInjection\Tests\Fixtures\PrototypeAsAlias \\' ,
@@ -374,6 +378,12 @@ public static function provideResourcesWithAsAliasAttributes(): iterable
374378 AliasBarInterface::class => new Alias (WithAsAliasIdMultipleInterface::class),
375379 AliasFooInterface::class => new Alias (WithAsAliasIdMultipleInterface::class),
376380 ]];
381+ yield 'Dev-env specific ' => ['PrototypeAsAlias/{WithAsAliasDevEnv, WithAsAliasProdEnv}.php ' , [
382+ AliasFooInterface::class => new Alias (WithAsAliasDevEnv::class),
383+ ], 'dev ' ];
384+ yield 'Prod-env specific ' => ['PrototypeAsAlias/{WithAsAliasDevEnv, WithAsAliasProdEnv}.php ' , [
385+ AliasFooInterface::class => new Alias (WithAsAliasProdEnv::class),
386+ ], 'prod ' ];
377387 }
378388
379389 /**
0 commit comments