File tree 1 file changed +19
-0
lines changed
src/Symfony/Component/DependencyInjection/Tests/Compiler 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -142,6 +142,21 @@ public function testCanDecorateServiceSubscriber()
142
142
$ this ->assertInstanceOf (DecoratedServiceSubscriber::class, $ container ->get (ServiceSubscriberStub::class));
143
143
}
144
144
145
+ public function testCanDecorateServiceLocator ()
146
+ {
147
+ $ container = new ContainerBuilder ();
148
+ $ container ->register (ServiceLocator::class)
149
+ ->addTag ('container.service_locator ' )
150
+ ;
151
+
152
+ $ container ->register (DecoratedServiceLocator::class)
153
+ ->setDecoratedService (ServiceLocator::class);
154
+
155
+ $ container ->compile ();
156
+
157
+ $ this ->assertInstanceOf (DecoratedServiceLocator::class, $ container ->get (DecoratedServiceLocator::class));
158
+ }
159
+
145
160
/**
146
161
* @dataProvider getYamlCompileTests
147
162
*/
@@ -416,6 +431,10 @@ class DecoratedServiceSubscriber
416
431
{
417
432
}
418
433
434
+ class DecoratedServiceLocator
435
+ {
436
+ }
437
+
419
438
class IntegrationTestStub extends IntegrationTestStubParent
420
439
{
421
440
}
You can’t perform that action at this time.
0 commit comments