Do not process bindings in AbstractRecursivePass

This commit is contained in:
Robin Chalas 2017-10-18 11:36:53 +02:00
parent 4a687759d5
commit 6a6256c6a8
2 changed files with 15 additions and 1 deletions

View File

@ -67,7 +67,6 @@ abstract class AbstractRecursivePass implements CompilerPassInterface
$value->setArguments($this->processValue($value->getArguments()));
$value->setProperties($this->processValue($value->getProperties()));
$value->setMethodCalls($this->processValue($value->getMethodCalls()));
$value->setBindings($this->processValue($value->getBindings()));
$changes = $value->getChanges();
if (isset($changes['factory'])) {

View File

@ -12,6 +12,7 @@
namespace Symfony\Component\DependencyInjection\Tests\Compiler;
use PHPUnit\Framework\TestCase;
use Symfony\Component\DependencyInjection\Argument\BoundArgument;
use Symfony\Component\DependencyInjection\Definition;
use Symfony\Component\DependencyInjection\Compiler\CheckExceptionOnInvalidReferenceBehaviorPass;
use Symfony\Component\DependencyInjection\Reference;
@ -88,6 +89,20 @@ class CheckExceptionOnInvalidReferenceBehaviorPassTest extends TestCase
$this->process($container);
}
public function testProcessDefinitionWithBindings()
{
$container = new ContainerBuilder();
$container
->register('b')
->setBindings(array(new BoundArgument(new Reference('a'))))
;
$this->process($container);
$this->addToAssertionCount(1);
}
private function process(ContainerBuilder $container)
{
$pass = new CheckExceptionOnInvalidReferenceBehaviorPass();