How to check for deprecations with PHPUnit tests #45531
-
To prepare for the new PHP 8.2 release, I was running my applications and test suites on the latest RC. Using the However when running the test suite, I am unable to check wether or not any deprecations were triggered during the tests. It seems that the test app container seems to catch all deprecations and handle them internally, so there's no way to find any trace of them. Anyone has any suggestions on how to make the deprecations show up in the PHPUnit output (or any other place even?) when running tests? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
Check this: https://laravel.com/docs/9.x/http-tests#exception-handling. |
Beta Was this translation helpful? Give feedback.
-
I have the same problem, was migrating to laravel 8, i assume laravel 9 should be similar
|
Beta Was this translation helpful? Give feedback.
-
phpunit has built-in support for reporting PHP deprecations, this can be controlled via things like However, all of this doesn't seem to apply because Laravel takes matters in its own hand. Sure you can run it like this: But: you will only get the log output intertwined with phpunit output that way, but phpunit is not able to "know" about tests being affected and can't mark them as Did anyone figure out how to better have this integrated with PHPUnit? |
Beta Was this translation helpful? Give feedback.
Check this: https://laravel.com/docs/9.x/http-tests#exception-handling.