Handle different error message when class does not exist
MODIFY
features/bootstrap/FeatureContext.php
features/bootstrap/FeatureContext.php
@@ -438,8 +438,9 @@ EOL;
// Replace wrong warning message of HHVM
$output = str_replace('Notice: Undefined index: ', 'Notice: Undefined offset: ', $output);
- // replace error message that changed in PHP
+ // replace error messages that changed in PHP8
$output = str_replace('Warning: Undefined array key','Notice: Undefined offset:', $output);
+ $output = preg_replace('/Class "([^"]+)" not found/', 'Class \'$1\' not found', $output);
return trim(preg_replace("/ +$/m", '', $output));
}

MODIFY
src/Behat/Testwork/Call/Handler/Exception/ClassNotFoundHandler.php
src/Behat/Testwork/Call/Handler/Exception/ClassNotFoundHandler.php
@@ -22,7 +22,7 @@ use Error;
*/
abstract class ClassNotFoundHandler implements ExceptionHandler
{
- public const PATTERN = "/^Class '([^']+)' not found$/";
+ public const PATTERN = "/^Class (?:'|\")([^'\"]+)(?:'|\") not found$/";
/**
* {@inheritdoc}

Handle different error message when class does not exist