Skip to content

Commit a76cbf2

Browse files
committed
[TEST] return second level of exception message if possible, for further testing
1 parent 496071c commit a76cbf2

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

tests/Elasticsearch/Tests/YamlRunnerTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -613,6 +613,9 @@ private function handleCaughtException(\Exception $exception, $expectedError) {
613613

614614
if ($passed === true) {
615615
$this->assertTrue(true);
616+
if ($exception->getPrevious() !== null) {
617+
return json_decode($exception->getPrevious()->getMessage(), true);
618+
}
616619
return json_decode($exception->getMessage(), true);
617620
}
618621

0 commit comments

Comments
 (0)