[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;
|
$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
|
||||||
|
|
Reference in a new issue