Skip to content

Commit

Permalink
[DependencyInjection] Fixed the priority of service decoration on ser…
Browse files Browse the repository at this point in the history
…vice with parent
  • Loading branch information
hason committed May 3, 2016
1 parent 7b3c65b commit d1ad43c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Expand Up @@ -174,7 +174,7 @@ private function resolveDefinition(ContainerBuilder $container, DefinitionDecora
if (null === $decoratedService) {
$def->setDecoratedService($decoratedService);
} else {
$def->setDecoratedService($decoratedService[0], $decoratedService[1]);
$def->setDecoratedService($decoratedService[0], $decoratedService[1], $decoratedService[2]);
}
}

Expand Down
Expand Up @@ -276,10 +276,12 @@ public function testSetDecoratedServiceOnServiceHasParent()
$container->register('parent', 'stdClass');

$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()
Expand Down

0 comments on commit d1ad43c

Please sign in to comment.