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
-------

8f0b629726 [DependencyInjection] Add a missing test for @required autowiring
This commit is contained in:
Fabien Potencier 2017-03-01 17:36:47 -08:00
commit 0caf212599

View File

@ -473,7 +473,7 @@ class AutowirePassTest extends TestCase
$methodCalls = $container->getDefinition('setter_injection')->getMethodCalls();
$this->assertEquals(
array('setWithCallsConfigured', 'setFoo', 'setDependencies'),
array('setWithCallsConfigured', 'setFoo', 'setDependencies', 'setChildMethodWithoutDocBlock'),
array_column($methodCalls, 0)
);
@ -509,7 +509,7 @@ class AutowirePassTest extends TestCase
$methodCalls = $container->getDefinition('setter_injection')->getMethodCalls();
$this->assertEquals(
array('notASetter', 'setFoo', 'setDependencies', 'setWithCallsConfigured'),
array('notASetter', 'setFoo', 'setDependencies', 'setWithCallsConfigured', 'setChildMethodWithoutDocBlock'),
array_column($methodCalls, 0)
);
$this->assertEquals(
@ -953,6 +953,10 @@ class SetterInjection extends SetterInjectionParent
{
// should not be called
}
public function setChildMethodWithoutDocBlock(A $a)
{
}
}
class SetterInjectionParent
@ -972,6 +976,11 @@ class SetterInjectionParent
public function setWithCallsConfigured(A $a)
{
}
/** @required */
public function setChildMethodWithoutDocBlock(A $a)
{
}
}
class SetterInjectionCollision