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

Allow to limit the reporting of deprecations, notices, and warnings to specified directories #5293

Closed
sebastianbergmann opened this issue Mar 31, 2023 · 1 comment
Assignees
Labels
feature/events Issues related to PHPUnit's event system feature/test-runner CLI test runner type/enhancement A new idea that should be implemented
Milestone

Comments

@sebastianbergmann
Copy link
Owner

sebastianbergmann commented Mar 31, 2023

As of PHPUnit 10.0, the test runner prints D, N, and W, respectively, for tests that execute code which triggers E_DEPRECATED, E_USER_DEPRECATED, E_NOTICE, E_USER_NOTICE, E_STRICT, E_WARNING, or E_USER_WARNING events.

Detailed information (which notices was triggered where, for instance) is only printed when --display-deprecations, --display-notices, or --display-warnings is used.

The test runner should support limiting the reporting of deprecations, notices, and warnings to "your code", excluding code from directories such as vendor, for example.

This depends on #5294.

@sebastianbergmann sebastianbergmann added type/enhancement A new idea that should be implemented feature/test-runner CLI test runner feature/events Issues related to PHPUnit's event system labels Mar 31, 2023
@sebastianbergmann sebastianbergmann added this to the PHPUnit 10.1 milestone Mar 31, 2023
@sebastianbergmann sebastianbergmann self-assigned this Mar 31, 2023
@acelaya
Copy link

acelaya commented Mar 31, 2023

Commenting here as I was notified by this superseding another issue I opened some time ago: #5191

The test runner should support limiting the reporting of deprecations, notices, and warnings to "your code", excluding code from directories such as vendor, for example.

I actually think it makes more sense the other way around. It can be useful to be notified about the usage of deprecated third party code, as it's easy for the deprecations to be unknown until it's "too" late.

As per the project's own code, the usage of deprecated symbols is probably known and there's plans to stop using them. It is also likely they were deprecated just to avoid using them by mistake in new code, but you don't need to be warned about your own code.

But of course I'm biased here and probably missing the big picture 😅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature/events Issues related to PHPUnit's event system feature/test-runner CLI test runner type/enhancement A new idea that should be implemented
Projects
None yet
Development

No branches or pull requests

2 participants