composer update
This commit is contained in:
@@ -149,7 +149,7 @@ class RegisterControllerArgumentLocatorsPassTest extends TestCase
|
||||
$this->assertSame(ServiceLocator::class, $locator->getClass());
|
||||
$this->assertFalse($locator->isPublic());
|
||||
|
||||
$expected = array('bar' => new ServiceClosureArgument(new TypedReference(ControllerDummy::class, ControllerDummy::class, ContainerInterface::RUNTIME_EXCEPTION_ON_INVALID_REFERENCE)));
|
||||
$expected = array('bar' => new ServiceClosureArgument(new TypedReference(ControllerDummy::class, ControllerDummy::class, ContainerInterface::RUNTIME_EXCEPTION_ON_INVALID_REFERENCE, 'bar')));
|
||||
$this->assertEquals($expected, $locator->getArgument(0));
|
||||
}
|
||||
|
||||
@@ -309,16 +309,23 @@ class RegisterControllerArgumentLocatorsPassTest extends TestCase
|
||||
|
||||
public function provideBindings()
|
||||
{
|
||||
return array(array(ControllerDummy::class), array('$bar'));
|
||||
return array(
|
||||
array(ControllerDummy::class.'$bar'),
|
||||
array(ControllerDummy::class),
|
||||
array('$bar'),
|
||||
);
|
||||
}
|
||||
|
||||
public function testBindScalarValueToControllerArgument()
|
||||
/**
|
||||
* @dataProvider provideBindScalarValueToControllerArgument
|
||||
*/
|
||||
public function testBindScalarValueToControllerArgument($bindingKey)
|
||||
{
|
||||
$container = new ContainerBuilder();
|
||||
$resolver = $container->register('argument_resolver.service')->addArgument(array());
|
||||
|
||||
$container->register('foo', ArgumentWithoutTypeController::class)
|
||||
->setBindings(array('$someArg' => '%foo%'))
|
||||
->setBindings(array($bindingKey => '%foo%'))
|
||||
->addTag('controller.service_arguments');
|
||||
|
||||
$container->setParameter('foo', 'foo_val');
|
||||
@@ -341,6 +348,12 @@ class RegisterControllerArgumentLocatorsPassTest extends TestCase
|
||||
$this->assertSame('foo_val', $container->get((string) $reference));
|
||||
}
|
||||
|
||||
public function provideBindScalarValueToControllerArgument()
|
||||
{
|
||||
yield array('$someArg');
|
||||
yield array('string $someArg');
|
||||
}
|
||||
|
||||
public function testBindingsOnChildDefinitions()
|
||||
{
|
||||
$container = new ContainerBuilder();
|
||||
@@ -420,7 +433,7 @@ class NonExistentClassOptionalController
|
||||
|
||||
class ArgumentWithoutTypeController
|
||||
{
|
||||
public function fooAction($someArg)
|
||||
public function fooAction(string $someArg)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user