8000 Test with decorated service locator · symfony/symfony@d835a8c · GitHub
[go: up one dir, main page]

Skip to content

Commit d835a8c

Browse files
committed
Test with decorated service locator
1 parent 418c78c commit d835a8c

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

src/Symfony/Component/DependencyInjection/Tests/Compiler/IntegrationTest.php

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,21 @@ public function testCanDecorateServiceSubscriber()
142142
$this->assertInstanceOf(DecoratedServiceSubscriber::class, $container->get(ServiceSubscriberStub::class));
143143
}
144144

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+
145160
/**
146161
* @dataProvider getYamlCompileTests
147162
*/
@@ -416,6 +431,10 @@ class DecoratedServiceSubscriber
416431
{
417432
}
418433

434+
class DecoratedServiceLocator
435+
{
436+
}
437+
419438
class IntegrationTestStub extends IntegrationTestStubParent
420439
{
421440
}

0 commit comments

Comments
 (0)
0