[core] fix error in error handling

This commit is contained in:
Shish 2024-01-11 10:19:38 +00:00
parent 36388aa7a1
commit acd3abcc77

View file

@ -208,12 +208,12 @@ if(class_exists("\\PHPUnit\\Framework\\TestCase")) {
$exception = $e;
}
if(is_a($exception, $type)) {
self::assertThat($exception, new \PHPUnit\Framework\Constraint\Exception($type));
return $exception;
} else {
throw $exception;
}
self::assertThat(
$exception,
new \PHPUnit\Framework\Constraint\Exception($type),
"Expected exception of type $type, but got " . ($exception ? get_class($exception) : "none")
);
return $exception;
}
// user things