[core] fix error in error handling
This commit is contained in:
parent
36388aa7a1
commit
acd3abcc77
1 changed files with 6 additions and 6 deletions
|
@ -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
|
||||
|
|
Reference in a new issue