[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; $exception = $e;
} }
if(is_a($exception, $type)) { self::assertThat(
self::assertThat($exception, new \PHPUnit\Framework\Constraint\Exception($type)); $exception,
new \PHPUnit\Framework\Constraint\Exception($type),
"Expected exception of type $type, but got " . ($exception ? get_class($exception) : "none")
);
return $exception; return $exception;
} else {
throw $exception;
}
} }
// user things // user things