-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Display deprecation stacktrace #5921
Comments
Indeed, we see that there's the first line of the stack trace, for example:
But when using the I'm not a huge fan of the |
maybe just a flag like |
Did you configure Symfony's |
nope, I didn't know about this configuration, and I think it will be the solution. Thanks! what about to detect the existence of such triggers to automatically register the main known ones? |
hum, it seems that it does not work as I expected: Something nice, would be to use these trigger deprecation in order to display the real place where the deprecation was triggered. meaning, instead of having this:
it would display:
|
Makes sense, I guess. Do you want to send a PR for this? |
yes, let's do this :) |
Hello,
sometimes finding where a deprecation comes from could be challenging. I think a mechanism in PHPUnit which displays the stack trace of deprecations would be helpful.
In Symfony, they've solved it by the following: if the
SYMFONY_DEPRECATIONS_HELPER
is a regex (I guess, they detect it if the var starts and ends with a/
, or something like this), they break PHPUnit execution when the first deprecation resolving this regex is found, and the stack trace is printed.see https://symfony.com/doc/current/components/phpunit_bridge.html#display-the-full-stack-trace
I'm not sure that breaking the execution is the best solution, but at least, it prevents for giant outputs if the test suite is full of deprecations.
I would be willing to contribute for this, but I'm not sure of how this should work. Do you see any other more elegant solution for this? Maybe we can add a new option which would display the stack traces, or at least write them in a file in order to not pollute the output?
thanks!
The text was updated successfully, but these errors were encountered: