Remove obsolete error handler that marked every test as risky#386
Merged
Conversation
The suppress-deprecations bootstrap file registered a global error
handler via Composer's autoload-dev files, beneath PHPUnit's own
handler. Laravel's HandleExceptions::flushHandlersState() pops the
entire error handler stack between tests, so PHPUnit 12 detected that
a handler from its pre-test baseline had been removed and marked all
675 tests as risky ("Test code or tested code removed error handlers
other than its own") in every CI matrix job.
The handler is no longer needed: it suppressed a PHP 8.5 deprecation
for PDO::MYSQL_ATTR_SSL_CA in Testbench's bundled database config, but
the only PHP 8.5 CI leg (Laravel 13, prefer-stable) now resolves
Testbench 11, which already uses Pdo\Mysql::ATTR_SSL_CA. Older
Testbench versions only run on PHP 8.3/8.4, where the constant is not
deprecated.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Every test (675) is reported as risky in every CI matrix job — e.g. this run. The compact CI output hides the reason, but running a single test locally shows:
Cause
workbench/bootstrap/suppress-deprecations.php(added in d1e0e50) registers a global error handler at autoload time via Composer'sautoload-dev.files, so it sits beneath PHPUnit's handler in every test's baseline. Laravel'sHandleExceptions::flushHandlersState()pops the entire error handler stack when Testbench tears the app down between tests. PHPUnit 12 then sees that a handler from its pre-test baseline is gone and flags the test as risky — for every single test.Fix
Delete the file and its
autoload-dev.filesentry. The handler is obsolete:PDO::MYSQL_ATTR_SSL_CAdeprecation triggered by Testbench's bundled database config.Pdo\Mysql::ATTR_SSL_CAconstant.Verification
Full suite locally after the change:
Zero risky, all passing.
🤖 Generated with Claude Code