[DependencyInjection] fix tests
This commit is contained in:
parent
6190058d5b
commit
0de21071c3
@ -96,7 +96,7 @@ class ReplaceAliasByActualDefinitionPass implements CompilerPassInterface
|
|||||||
$this->updateArgumentReferences($definition->getProperties(), $currentId, $newId)
|
$this->updateArgumentReferences($definition->getProperties(), $currentId, $newId)
|
||||||
);
|
);
|
||||||
|
|
||||||
$definition->setFactoryService($this->updateFactoryServiceReference($definition->getFactoryService(), $currentId, $newId));
|
$definition->setFactoryService($this->updateFactoryServiceReference($definition->getFactoryService(false), $currentId, $newId), false);
|
||||||
$definition->setFactory($this->updateFactoryReference($definition->getFactory(), $currentId, $newId));
|
$definition->setFactory($this->updateFactoryReference($definition->getFactory(), $currentId, $newId));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -23,8 +23,7 @@ class ReplaceAliasByActualDefinitionPassTest extends \PHPUnit_Framework_TestCase
|
|||||||
$container = new ContainerBuilder();
|
$container = new ContainerBuilder();
|
||||||
|
|
||||||
$aDefinition = $container->register('a', '\stdClass');
|
$aDefinition = $container->register('a', '\stdClass');
|
||||||
$aDefinition->setFactoryService('b');
|
$aDefinition->setFactoryService('b', false);
|
||||||
$aDefinition->setFactoryMethod('createA');
|
|
||||||
|
|
||||||
$aDefinition->setFactory(array(new Reference('b'), 'createA'));
|
$aDefinition->setFactory(array(new Reference('b'), 'createA'));
|
||||||
|
|
||||||
@ -45,9 +44,9 @@ class ReplaceAliasByActualDefinitionPassTest extends \PHPUnit_Framework_TestCase
|
|||||||
'->process() replaces alias to actual.'
|
'->process() replaces alias to actual.'
|
||||||
);
|
);
|
||||||
|
|
||||||
$this->assertSame('b_alias', $aDefinition->getFactoryService());
|
$this->assertSame('b_alias', $aDefinition->getFactoryService(false));
|
||||||
|
|
||||||
$resolvedFactory = $aDefinition->getFactory();
|
$resolvedFactory = $aDefinition->getFactory(false);
|
||||||
$this->assertSame('b_alias', (string) $resolvedFactory[0]);
|
$this->assertSame('b_alias', (string) $resolvedFactory[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user