new FrameworkExtension())->
load([['annotations' => false, 'http_method_override' => false, 'handle_all_throwables' => true, 'php_errors' =>
['log' => true
]]],
$container);
$this->
assertCount(1,
$container->
getDefinition('config_cache_factory'
)->
getArguments());
$container =
$this->
createContainer(['kernel.debug' => false
]);
(new FrameworkExtension())->
load([['annotations' => false, 'http_method_override' => false, 'handle_all_throwables' => true, 'php_errors' =>
['log' => true
]]],
$container);
$this->
assertEmpty($container->
getDefinition('config_cache_factory'
)->
getArguments());
} public function testLoggerAwareRegistration() { $container =
$this->
createContainerFromFile('full',
[], true, false
);
$container->
addCompilerPass(new ResolveInstanceofConditionalsPass());
$container->
register('foo', LoggerAwareInterface::
class) ->
setAutoconfigured(true
);
$container->
compile();
$calls =
$container->
findDefinition('foo'
)->
getMethodCalls();
$this->
assertCount(1,
$calls, 'Definition should contain 1 method call'
);
$this->
assertSame('setLogger',
$calls[0
][0
], 'Method name should be "setLogger"'
);
$this->
assertInstanceOf(Reference::
class,
$calls[0
][1
][0
]);
$this->
assertSame('logger',
(string) $calls[0
][1
][0
], 'Argument should be a reference to "logger"'
);
}