[DependencyInjection] Fixed the priority of service decoration on service with parent
This commit is contained in:
parent
7b3c65bf67
commit
d1ad43c174
@ -174,7 +174,7 @@ class ResolveDefinitionTemplatesPass implements CompilerPassInterface
|
|||||||
if (null === $decoratedService) {
|
if (null === $decoratedService) {
|
||||||
$def->setDecoratedService($decoratedService);
|
$def->setDecoratedService($decoratedService);
|
||||||
} else {
|
} else {
|
||||||
$def->setDecoratedService($decoratedService[0], $decoratedService[1]);
|
$def->setDecoratedService($decoratedService[0], $decoratedService[1], $decoratedService[2]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -276,10 +276,12 @@ class ResolveDefinitionTemplatesPassTest extends \PHPUnit_Framework_TestCase
|
|||||||
$container->register('parent', 'stdClass');
|
$container->register('parent', 'stdClass');
|
||||||
|
|
||||||
$container->setDefinition('child1', new DefinitionDecorator('parent'))
|
$container->setDefinition('child1', new DefinitionDecorator('parent'))
|
||||||
->setDecoratedService('foo', 'foo_inner')
|
->setDecoratedService('foo', 'foo_inner', 5)
|
||||||
;
|
;
|
||||||
|
|
||||||
$this->assertEquals(array('foo', 'foo_inner', 0), $container->getDefinition('child1')->getDecoratedService());
|
$this->process($container);
|
||||||
|
|
||||||
|
$this->assertEquals(array('foo', 'foo_inner', 5), $container->getDefinition('child1')->getDecoratedService());
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testDecoratedServiceCopiesDeprecatedStatusFromParent()
|
public function testDecoratedServiceCopiesDeprecatedStatusFromParent()
|
||||||
|
Reference in New Issue
Block a user