8000 minor #21829 [DependencyInjection] Add a missing test for @required a… · symfony/symfony@0caf212 · GitHub
[go: up one dir, main page]

Skip to content

Commit 0caf212

Browse files
committed
minor #21829 [DependencyInjection] Add a missing test for @required autowiring (dunglas)
This PR was merged into the 3.3-dev branch. Discussion ---------- [DependencyInjection] Add a missing test for @required autowiring | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | n/a | License | MIT | Doc PR | n/a Commits ------- 8f0b629 [DependencyInjection] Add a missing test for @required autowiring
2 parents 3fa8a05 + 8f0b629 commit 0caf212

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

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

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -473,7 +473,7 @@ public function testSetterInjection()
473473
$methodCalls = $container->getDefinition('setter_injection')->getMethodCalls();
474474

475475
$this->assertEquals(
476-
array('setWithCallsConfigured', 'setFoo', 'setDependencies'),
476+
array('setWithCallsConfigured', 'setFoo', 'setDependencies', 'setChildMethodWithoutDocBlock'),
477477
array_column($methodCalls, 0)
478478
);
479479

@@ -509,7 +509,7 @@ public function testExplicitMethodInjection()
509509
$methodCalls = $container->getDefinition('setter_injection')->getMethodCalls();
510510

511511
$this->assertEquals(
512-
array('notASetter', 'setFoo', 'setDependencies', 'setWithCallsConfigured'),
512+
array('notASetter', 'setFoo', 'setDependencies', 'setWithCallsConfigured', 'setChildMethodWithoutDocBlock'),
513513
array_column($methodCalls, 0)
514514
);
515515
$this->assertEquals(
@@ -953,6 +953,10 @@ protected function setProtectedMethod(A $a)
953953
{
954954
// should not be called
955955
}
956+
957+
public function setChildMethodWithoutDocBlock(A $a)
958+
{
959+
}
956960
}
957961

958962
class SetterInjectionParent
@@ -972,6 +976,11 @@ public function notASetter(A $a)
972976
public function setWithCallsConfigured(A $a)
973977
{
974978
}
979+
980+
/** @required */
981+
public function setChildMethodWithoutDocBlock(A $a)
982+
{
983+
}
975984
}
976985

977986
class SetterInjectionCollision

0 commit comments

Comments
 (0)
0