Closed
Description
Symfony version(s) affected
6.4.x
Description
When I run PHPUnit in a symfony project using phpunit-bridge version 6.4.x-dev 15607a3 I run into this message:
PHPUnit 10.5.20 by Sebastian Bergmann and contributors.
Error in bootstrap script: PHPUnit\Event\Code\NoTestCaseObjectOnCallStackException:
Cannot find TestCase object on call stack
#0 [path to]/vendor/phpunit/phpunit/src/Runner/ErrorHandler.php(64): PHPUnit\Event\Code\TestMethodBuilder::fromCallStack()
#1 [path to]/vendor/symfony/phpunit-bridge/DeprecationErrorHandler.php(381): PHPUnit\Runner\ErrorHandler->__invoke(2, 'include([path to]...', '[path to]...', 9)
#2 [path to]/vendor/symfony/phpunit-bridge/DeprecationErrorHandler.php(132): Symfony\Bridge\PhpUnit\DeprecationErrorHandler::Symfony\Bridge\PhpUnit\{closure}(2, 'include([path to]...', '[path to]...', 9, Array)
#3 [path to]/config/bootstrap.php(9): Symfony\Bridge\PhpUnit\DeprecationErrorHandler->handleError(2, 'include([path to]...', '[path to]...', 9)
#4 [path to]/config/bootstrap.php(9): include('[path to]')
#5 [path to]/tests/bootstrap.php(3): require('[path to]')
#6 [path to]/vendor/phpunit/phpunit/src/TextUI/Application.php(313): include_once('[path to]')
#7 [path to]/vendor/phpunit/phpunit/src/TextUI/Application.php(104): PHPUnit\TextUI\Application->loadBootstrapScript('[path to]')
#8 [path to]/vendor/phpunit/phpunit/phpunit(104): PHPUnit\TextUI\Application->run(Array)
#9 [path to]/bin/phpunit(122): include('[path to]')
#10 {main}
When I run the same tests but with phpunit-bridge 6.4.7 everything works as expected.
How to reproduce
Set up a symfony project using phpunit-bridge and run phpunit.
I am still investigating this in more detail
Possible Solution
No response
Additional Context
No response