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
I encountered an issue where a PDOException with the error code 'HY000' is caught and rethrown in phpunit/src/Framework/Constraint/Cardinality/Count.php:70, but PHPUnit throws an error because PHPUnit\Framework\Exception only accepts integer error codes.
How to reproduce
Use a test case that triggers a PDOException with the error code 'HY000'.
The exception is caught and rethrown in Count.php:70 as follows:
try {
$other = $other->getIterator();
} catch (\Exception$e) {
thrownewException(
$e->getMessage(),
$e->getCode(), // This throws the error as it passes 'HY000' (a string) instead of an integer$e
);
}
Since PHPUnit\Framework\Exception expects an integer for the error code, it causes a type mismatch, resulting in an error.