phpunit
phpunit copied to clipboard
Provide a way to stop execution at a particular deprecation
Deprecation are sometimes hard to track. Figuring the exact stack trace for one particular deprecation is really useful to understand how it comes up and fix it.
It would be awesome to have a command line option (or similar) to tell phpunit to stop and display its stacktrace when a specific deprecation occurs. The match would happen by checking the deprecation message.
For example:
phpunit --stop-on-deprecation="part of the deprecation message"
For sinpiration this capability exists when using Symfony's phpunit-brigde, as documented at https://symfony.com/doc/current/components/phpunit_bridge.html#configuration
Is this not two separate things?
- Display full stack trace (without frames from PHPUnit and its dependencies) for deprecations
- Support
--stop-on-deprecation="part of the deprecation message"
It could be, but displaying stacktraces for deprecations standalone is not useful nor actionable: deprecations are best reported grouped, which means without stacktraces. On the other side, stopping on one specific deprecation without the stacktrace just asking to run the command again to make it display the stacktrace. Thus combined behavior is the most useful and actionable.