-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[DependencyInjection] Fix FactoryReturnTypePass position in PassConfig #20263
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
hason
commented
Oct 21, 2016
Q | A |
---|---|
Branch? | master |
Bug fix? | yes |
New feature? | no |
BC breaks? | no |
Deprecations? | no |
Tests pass? | yes |
Fixed tickets | #19161, #19191 |
License | MIT |
Doc PR |
} else { | ||
$this->assertEquals('Please add the class to service "factory" even if it is constructed by a factory since we might need to add method calls based on compile-time checks.', $e->getMessage()); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this test will not fail if no RuntimeException is thrown, and there is no assertion in this case
if (method_exists(\ReflectionMethod::class, 'getReturnType')) { | ||
$this->fail('The FactoryReturnTypePass should set the class to service "factory".'); | ||
} else { | ||
$this->assertEquals('Please add the class to service "factory" even if it is constructed by a factory since we might need to add method calls based on compile-time checks.', $e->getMessage()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rather than this, use ->setExpectedException()
instead (only on PHP 5) and don't catch the exception. It will avoid the need to fail manually.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your tip.
Thank you @hason. |
…n PassConfig (hason) This PR was merged into the 3.2-dev branch. Discussion ---------- [DependencyInjection] Fix FactoryReturnTypePass position in PassConfig | Q | A | ------------- | --- | Branch? | master | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #19161, #19191 | License | MIT | Doc PR | Commits ------- dfb5cc3 [DependencyInjection] Fix FactoryReturnTypePass position in PassConfig