-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Bridge\PhpUnit] Disable broken auto-require mechanism of phpunit #25032
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
[Bridge\PhpUnit] Disable broken auto-require mechanism of phpunit #25032
Conversation
af081f3
to
0577d20
Compare
moved to 3.3 to prevent conflicts between local and vendor phpunit bridges |
…phpunit (nicolas-grekas) This PR was merged into the 3.3 branch. Discussion ---------- [Bridge\PhpUnit] Disable broken auto-require mechanism of phpunit | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #25017 | License | MIT | Doc PR | - It took me all the flight back from Cluj to figure out this is the only way to solve this nasty issue created by phpunit generating inlined `require_once` in the global scope for isolated tests. This mechanism predates the autoloading mechanism, and it's behavior is just hardcoded. Needs to be merged in 3.4, where the split container triggers this situation very quickly. Will allow removing the `function_exists('__phpunit_run_isolated_test')` workarounds already in place in the code base (2.7 up to master.) Commits ------- 0577d20 [Bridge\PhpUnit] Disable broken auto-require mechanism of phpunit
…ks (nicolas-grekas) This PR was merged into the 2.7 branch. Discussion ---------- Remove function_exists(__phpunit_run_isolated_test) checks | Q | A | ------------- | --- | Branch? | 2.7 | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | - | License | MIT | Doc PR | - As now permitted by #25032 Commits ------- a512217 Remove function_exists(__phpunit_run_isolated_test) checks
I'm getting
since upgrading to the latest 3.4. Not entirely sure it's related yet. UPDATE: I have the same issue with 3.x, I'll try bisecting. |
0577d20 is the first bad commit
|
did you remove the |
I just tried removing |
Here is a simple reproducer:
|
@greg0ire can you try again? could/should be fixed. |
No luck it seems, with both the phar and simple-phpunit (with
|
ok, then I need a reproducer that actually works :) |
Here you go:
Not sure why this can't be reproduced easily 😅 |
@greg0ire OK, actually that's a bug in Sonata's tests/bootstrap.php: |
Thanks a lot for the diagnosis, sorry we had that weird stuff, we're going to simplify. Cc @soullivaneuh @core23 @OskarStark @jordisala1991 @jlamur |
So there is no other way than to use |
It took me all the flight back from Cluj to figure out this is the only way to solve this nasty issue created by phpunit generating inlined
require_once
in the global scope for isolated tests.This mechanism predates the autoloading mechanism, and it's behavior is just hardcoded.
Needs to be merged in 3.4, where the split container triggers this situation very quickly.
Will allow removing the
function_exists('__phpunit_run_isolated_test')
workarounds already in place in the code base (2.7 up to master.)