Jun 6, 2024
0
Level 9
Covering tests with PHPStan (Opinion wanted)
I would love to hear opinion of the community about including tests folder in PHPStan paths.
I've checked many laravel first-party repos, and none of them add /tests path to PHPStan config. From 10 most popular OSS laravel projects, I've found only one with tests covered with static analysis.
My understanding is that tests are designed to fail if anything went wrong, so they need to be fragile and making them more durable is not needed. Why would I prevent some exception to happen if any exception is the normal way to mark test as failed.
What do you think?
Please or to participate in this conversation.