You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Found when running LiipFunctionalTestBundle's test suite again symfony 3.4.
The issue is that phpunit's @runInSeparateProcess feature is very risky as it requires all files required before, even-though no all file are require-able as such.
Some ideas to fix this:
enable processIsolation=true in the bundle's phpunit.xml.dist, which is free from the issue
not split the container in several files for tests
find a way around in phpunit-bridge
I hope 3 is actually possible, that'd be best.
The text was updated successfully, but these errors were encountered:
nicolas-grekas
changed the title
Fatal error: $this when not in object context in .../getCacheWarmerService.php
Fatal error: $this when not in object context in .../get[...]Service.php
Nov 18, 2017
…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
Found when running LiipFunctionalTestBundle's test suite again symfony 3.4.
The issue is that phpunit's
@runInSeparateProcess
feature is very risky as it requires all files required before, even-though no all file are require-able as such.Some ideas to fix this:
processIsolation=true
in the bundle's phpunit.xml.dist, which is free from the issueI hope 3 is actually possible, that'd be best.
The text was updated successfully, but these errors were encountered: