public function ContainerBuilderTest::testAddClassResource 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::testAddClassResource()
@covers Symfony\Component\DependencyInjection\ContainerBuilder::addClassResource
File
- vendor/
symfony/ dependency-injection/ Tests/ ContainerBuilderTest.php, line 569
Class
Namespace
Symfony\Component\DependencyInjection\TestsCode
public function testAddClassResource() {
$container = new ContainerBuilder();
$container
->setResourceTracking(false);
$container
->addClassResource(new \ReflectionClass('BarClass'));
$this
->assertEmpty($container
->getResources(), 'No resources get registered without resource tracking');
$container
->setResourceTracking(true);
$container
->addClassResource(new \ReflectionClass('BarClass'));
$resources = $container
->getResources();
$this
->assertCount(1, $resources, '1 resource was registered');
/* @var $resource \Symfony\Component\Config\Resource\FileResource */
$resource = end($resources);
$this
->assertInstanceOf('Symfony\\Component\\Config\\Resource\\FileResource', $resource);
$this
->assertSame(realpath(__DIR__ . '/Fixtures/includes/classes.php'), realpath($resource
->getResource()));
}