-
Notifications
You must be signed in to change notification settings - Fork 33
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
Improve PHPUnit assertions #82
base: master
Are you sure you want to change the base?
Conversation
Kind of interesting with this change in a test-case:
psalm says:
looks like that now being an assertion psalm over-emphasizes the fact that it's a known type now, feeling a bit like not seeing the whole picture, this came a bit unexpected to me. |
Just pushed another change that turns |
The two assertion methods: - assertArrayHasKey - assertArrayNotHasKey benefit from a @psalm-assert as well.
Make PHPUnit assertion of an array-key of an actual array redundant condition free on evaluation and reconciliation of an actual array to the array type in the psalm-assertion.
\Enhance\Assert::areIdentical($expected, $actual); |
\Enhance\Assert::throws($someClass, 'MethodName'); \Enhance\Assert::throws($someClass, 'MethodName', array(2, 'Arg2', 5)); |
@Rahul-coder01 Care to elaborate? I must admit I have no clue what that code is referring to but might just be me not seeing the wood for the trees. Thanks. |
Improve PHPUnit assertions
The two assertion methods:
benefit from a @psalm-assert as well.