37
37
use Symfony \Component \DependencyInjection \ChildDefinition ;
38
38
use Symfony \Component \DependencyInjection \Compiler \CompilerPassInterface ;
39
39
use Symfony \Component \DependencyInjection \Compiler \ResolveInstanceofConditionalsPass ;
40
+ use Symfony \Component \DependencyInjection \Compiler \ResolveTaggedIteratorArgumentPass ;
40
41
use Symfony \Component \DependencyInjection \ContainerBuilder ;
41
42
use Symfony \Component \DependencyInjection \ContainerInterface ;
42
43
use Symfony \Component \DependencyInjection \Definition ;
@@ -2057,7 +2058,9 @@ public function testLocaleSwitcherServiceRegistered()
2057
2058
$ this ->markTestSkipped ('LocaleSwitcher not available. ' );
2058
2059
}
2059
2060
2060
- $ container = $ this ->createContainerFromFile ('full ' );
2061
+ $ container = $ this ->createContainerFromFile ('full ' , compile: false );
2062
+ $ container ->addCompilerPass (new ResolveTaggedIteratorArgumentPass ());
2063
+ $ container ->compile ();
2061
2064
2062
2065
$ this ->assertTrue ($ container ->has ('translation.locale_switcher ' ));
2063
2066
@@ -2067,6 +2070,10 @@ public function testLocaleSwitcherServiceRegistered()
2067
2070
$ this ->assertInstanceOf (TaggedIteratorArgument::class, $ switcherDef ->getArgument (1 ));
2068
2071
$ this ->assertSame ('kernel.locale_aware ' , $ switcherDef ->getArgument (1 )->getTag ());
2069
2072
$ this ->assertEquals (new Reference ('router.request_context ' , ContainerBuilder::IGNORE_ON_INVALID_REFERENCE ), $ switcherDef ->getArgument (2 ));
2073
+
2074
+ $ localeAwareServices = array_map (fn (Reference $ r ) => (string ) $ r , $ switcherDef ->getArgument (1 )->getValues ());
2075
+
2076
+ $ this ->assertNotContains ('translation.locale_switcher ' , $ localeAwareServices );
2070
2077
}
2071
2078
2072
2079
public function testHtmlSanitizer ()
0 commit comments