public function ContainerBuilderTest::testCompilesClassDefinitionsOfLazyServices in Zircon Profile 8
Same name and namespace in other branches
- 8.0 vendor/symfony/dependency-injection/Tests/ContainerBuilderTest.php \Symfony\Component\DependencyInjection\Tests\ContainerBuilderTest::testCompilesClassDefinitionsOfLazyServices()
@covers Symfony\Component\DependencyInjection\ContainerBuilder::compile
File
- vendor/
symfony/ dependency-injection/ Tests/ ContainerBuilderTest.php, line 595
Class
Namespace
Symfony\Component\DependencyInjection\TestsCode
public function testCompilesClassDefinitionsOfLazyServices() {
$container = new ContainerBuilder();
$this
->assertEmpty($container
->getResources(), 'No resources get registered without resource tracking');
$container
->register('foo', 'BarClass');
$container
->getDefinition('foo')
->setLazy(true);
$container
->compile();
$classesPath = realpath(__DIR__ . '/Fixtures/includes/classes.php');
$matchingResources = array_filter($container
->getResources(), function (ResourceInterface $resource) use ($classesPath) {
return $resource instanceof FileResource && $classesPath === realpath($resource
->getResource());
});
$this
->assertNotEmpty($matchingResources);
}