static::
bootKernel(['root_config' => 'with_annotations.yml', 'environment' => 'with_annotations'
]);
$annotationReader = self::
getContainer()->
get('test.autowiring_types.autowired_services'
)->
getAnnotationReader();
$this->
assertInstanceOf(PsrCachedReader::
class,
$annotationReader);
} public function testEventDispatcherAutowiring() { static::
bootKernel(['debug' => false
]);
$autowiredServices = self::
getContainer()->
get('test.autowiring_types.autowired_services'
);
$this->
assertInstanceOf(EventDispatcher::
class,
$autowiredServices->
getDispatcher(), 'The event_dispatcher service should be injected if the debug is not enabled'
);
static::
bootKernel(['debug' => true
]);
$autowiredServices = self::
getContainer()->
get('test.autowiring_types.autowired_services'
);
$this->
assertInstanceOf(TraceableEventDispatcher::
class,
$autowiredServices->
getDispatcher(), 'The debug.event_dispatcher service should be injected if the debug is enabled'
);
} public function testCacheAutowiring() { static::
bootKernel();