Skip to content

[PHPUnit bridge] Do not register error handler under PHPUnit 10 #49440

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

Closed

Conversation

Jean85
Copy link
Contributor

@Jean85 Jean85 commented Feb 18, 2023

Q A
Branch? 5.4
Bug fix? yes
New feature? no
Deprecations? no
Tickets Fix #49069 (partially)
License MIT

This is motivated by #49069 (comment), until #49069 is fully addressed.

What happens is that PHPUnit 10 now registers its own error handler to trap notice/warnings/deprecations and make them flow through its new event system. The PHPUnit 10 compat for the deprecations handler will have to leverage those events, but as of now having two error handlers is just causing errors, and it does not make sense spending work to make them compatible. Hence, this patch.

@carsonbot
Copy link

Hey!

Thanks for your PR. You are targeting branch "6.3" but it seems your PR description refers to branch "5.4".
Could you update the PR description or change target branch? This helps core maintainers a lot.

Cheers!

Carsonbot

@Jean85 Jean85 changed the base branch from 6.3 to 5.4 February 18, 2023 21:38
@arderyp
Copy link
Contributor

arderyp commented Feb 23, 2023

thanks for the work @Jean85! I hope to see this merged until the bridge can officially support PHPUnit 10

@temp
Copy link

temp commented Apr 19, 2023

\PHPUnit\Event\Event is not present in phpunit 10, it was changed (some time ago):
https://github.com/sebastianbergmann/phpunit/commits/10.0.0/src/Event/Events/Event.php

Maybe it should be changed to \PHPUnit\Event\Events\Event.

@arderyp
Copy link
Contributor

arderyp commented Apr 19, 2023

@temp I'm not sure, but that may be a BC break. This package is designed to work with multiple versions of phpunit, including (I believe) versions that predate that change

Also, I'm struggling to find the commit/issue but I believe the symfony team made a change this year to prevent phpunit bridge from being installed alongside 10. In other words, i think they decided to implement a "fix" for this issue, but one that was less forgiving than the suggestion here for those of us who want to run phpunit 10

@nicolas-grekas nicolas-grekas modified the milestones: 6.3, 6.4 May 23, 2023
@nicolas-grekas nicolas-grekas modified the milestones: 6.4, 7.1 Nov 15, 2023
@chalasr
Copy link
Member

chalasr commented Mar 29, 2025

##49069 has been fixed meanwhile. Closing, please consider reopening if it's still relevant

@chalasr chalasr closed this Mar 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[PHPUnit bridge] Support for PHPUnit 11.1+
6 participants