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

Emit events for E_* and E_USER_* triggered in data provider methods #5775

Open
nikophil opened this issue Mar 29, 2024 · 2 comments · May be fixed by #5784
Open

Emit events for E_* and E_USER_* triggered in data provider methods #5775

nikophil opened this issue Mar 29, 2024 · 2 comments · May be fixed by #5784
Assignees
Labels
feature/data-provider Data Providers feature/events Issues related to PHPUnit's event system feature/test-runner CLI test runner type/enhancement A new idea that should be implemented

Comments

@nikophil
Copy link
Contributor

Q A
PHPUnit version 11.0.9
PHP version 8.3.4
Installation Method Composer / PHAR

Summary

Hello,

I don't know if it is a known issue, I've looked for a related one and did not find it.

It seems that a deprecation triggered in a data provider will not be reported by phpunit.

Current behavior

If we call @trigger_error('some deprecation', \E_USER_DEPRECATED) in a data provider, no deprecation warning is displayed. Even with ignoreSuppressionOfDeprecations="true"

How to reproduce

call trigger_error('some deprecation', \E_USER_DEPRECATED) in a data provider

Expected behavior

a D should be displayed instead of a .

@nikophil nikophil added the type/bug Something is broken label Mar 29, 2024
@sebastianbergmann
Copy link
Owner

I do not consider this a bug, because the current behavior is intentional. I must think about whether I want to change this behavior.

@sebastianbergmann sebastianbergmann added feature/test-runner CLI test runner feature/data-provider Data Providers feature/events Issues related to PHPUnit's event system and removed type/bug Something is broken labels Mar 29, 2024
@sebastianbergmann sebastianbergmann changed the title Deprecations triggered in data providers are not displayed No event is emitted for a deprecation that is triggered in a data provider Mar 29, 2024
@sebastianbergmann sebastianbergmann changed the title No event is emitted for a deprecation that is triggered in a data provider No event is emitted for E_* and E_USER_* triggered in data provider methods Mar 31, 2024
@sebastianbergmann sebastianbergmann added the type/enhancement A new idea that should be implemented label Mar 31, 2024
@sebastianbergmann sebastianbergmann changed the title No event is emitted for E_* and E_USER_* triggered in data provider methods Emit events for E_* and E_USER_* triggered in data provider methods Mar 31, 2024
@sebastianbergmann sebastianbergmann self-assigned this Mar 31, 2024
sebastianbergmann added a commit that referenced this issue Mar 31, 2024
…xecution (for instance data provider method execution for #5775)
@sebastianbergmann
Copy link
Owner

I started working on this in #5784.

@sebastianbergmann sebastianbergmann added this to the PHPUnit 11.2 milestone Mar 31, 2024
sebastianbergmann added a commit that referenced this issue Apr 1, 2024
…xecution (for instance data provider method execution for #5775)
sebastianbergmann added a commit that referenced this issue Apr 1, 2024
…xecution (for instance data provider method execution for #5775)
sebastianbergmann added a commit that referenced this issue Apr 2, 2024
…xecution (for instance data provider method execution for #5775)
sebastianbergmann added a commit that referenced this issue Apr 2, 2024
…xecution (for instance data provider method execution for #5775)
sebastianbergmann added a commit that referenced this issue Apr 12, 2024
…xecution (for instance data provider method execution for #5775)
sebastianbergmann added a commit that referenced this issue Apr 13, 2024
…xecution (for instance data provider method execution for #5775)
sebastianbergmann added a commit that referenced this issue Apr 18, 2024
…xecution (for instance data provider method execution for #5775)
@sebastianbergmann sebastianbergmann removed this from the PHPUnit 11.3 milestone Jul 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature/data-provider Data Providers 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

Successfully merging a pull request may close this issue.

2 participants