8000 minor #17909 [DependencyInjection] fix tests (xabbuh) · symfony/symfony@40e5f78 · GitHub
[go: up one dir, main page]

Skip to content

Commit 40e5f78

Browse files
committed
minor #17909 [DependencyInjection] fix tests (xabbuh)
This PR was merged into the 2.7 branch. Discussion ---------- [DependencyInjection] fix tests | Q | A | ------------- | --- | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | | License | MIT | Doc PR | Commits ------- 0de2107 [DependencyInjection] fix tests
2 parents 6190058 + 0de2107 commit 40e5f78

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

src/Symfony/Component/DependencyInjection/Compiler/ReplaceAliasByActualDefinitionPass.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ private function updateReferences($container, $currentId, $newId)
9696
$this->updateArgumentReferences($definition->getProperties(), $currentId, $newId)
9797
);
9898

99-
$definition->setFactoryService($this->updateFactoryServiceReference($definition->getFactoryService(), $currentId, $newId));
99+
$definition->setFactoryService($this->updateFactoryServiceReference($definition->getFactoryService(false), $currentId, $newId), false);
100100
$definition->setFactory($this->updateFactoryReference($definition->getFactory(), $currentId, $newId));
101101
}
102102
}

src/Symfony/Component/DependencyInjection/Tests/Compiler/ReplaceAliasByActualDefinitionPassTest.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,7 @@ public function testProcess()
2323
$container = new ContainerBuilder();
2424

2525
$aDefinition = $container->register('a', '\stdClass');
26-
$aDefinition->setFactoryService('b');
27-
$aDefinition->setFactoryMethod('createA');
26+
$aDefinition->setFactoryService('b', false);
2827

2928
$aDefinition->setFactory(array(new Reference('b'), 'createA'));
3029

@@ -45,9 +44,9 @@ public function testProcess()
4544
'->process() replaces alias to actual.'
4645
);
4746

48-
$this->assertSame('b_alias', $aDefinition->getFactoryService());
47+
$this->assertSame('b_alias', $aDefinition->getFactoryService(false));
4948

50-
$resolvedFactory = $aDefinition->getFactory();
49+
$resolvedFactory = $aDefinition->getFactory(false);
5150
$this->assertSame('b_alias', (string) $resolvedFactory[0]);
5251
}
5352

0 commit comments

Comments
 (0)
0