Skip to content
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

Symfony DeprecationHandler produces useless info for deprecations #41

Open
acrobat opened this issue Aug 30, 2018 · 0 comments
Open

Symfony DeprecationHandler produces useless info for deprecations #41

acrobat opened this issue Aug 30, 2018 · 0 comments

Comments

@acrobat
Copy link
Contributor

acrobat commented Aug 30, 2018

When you have the symfony/phpunit-bridge installed, codeception will register the test listener to enhance the test suite and deprecation output. But because the tests run through codeception the information in the output about where a certain deprecation is triggered is quite useless.

Normally the will show where a deprecation is triggered but it now only shows Application::run as the trigger location. In a "normal" phpunit setup it shows the correct class where the deprecation is triggered.

Phpunit output:

2x: The "%provider_keys%" is deprecated. Use "toolbar_firewall_names" instead
    2x in ConfigurationTest::testConfigGeneratesAsExpected from Kunstmaan\AdminBundle\Tests\DependencyInjection

Codeception output:

2x: The "%provider_keys%" is deprecated. Use "toolbar_firewall_names" instead
    2x in Application::run from Codeception

This is checked in this part of the deprecation handler: https://github.com/symfony/phpunit-bridge/blob/a00e342346a34c87bd11c3d4f2f93cee1585fb2c/DeprecationErrorHandler.php#L116

The deprecation handler will get the full trace and will wall back over it until it finds a "usefull" class that triggered the deprection. So it will skip phpunit classes, but in the codeception setup it will find codeception classes first so it thinks these classes have triggered the deprecation.

Example phpunit trace

* actual class triggering the deprecation
* phpunit runner
* phpunit
* phpunit

Example codeception trace

* actual class triggering the deprecation
* phpunit runner
* phpunit
* phpunit
* Symfony console
* codeception internal classes
* codeception application
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant