Idea: Suggest *static* method syntax in unit tests? #6043
ThomasLandauer
started this conversation in
Ideas
Replies: 1 comment
-
I think that it would increase confusion if it was recommended to use static assertions in Unit tests but the same methods provided by Asserts module would have to be called non-statically. Unit tests is the area where Codeception doesn't provide much over standard PHPUnit functionality, so they should be coded in PHPUnit way and it isn't up to us to set best practices for PHPUnit tests. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
When I'm using the syntax recommended at https://codeception.com/docs/05-UnitTests#Unit-Testing in a unit test
...I'm getting this error from phpstan:
So the (for phpstan) correct way would be:
However, https://phpunit.readthedocs.io/en/9.3/assertions.html#static-vs-non-static-usage-of-assertion-methods says about
->
vs.::
:What do you think?
Beta Was this translation helpful? Give feedback.
All reactions