diff --git a/src/Illuminate/Testing/TestResponse.php b/src/Illuminate/Testing/TestResponse.php index ea19db479a03..ebf06a7dc1fd 100644 --- a/src/Illuminate/Testing/TestResponse.php +++ b/src/Illuminate/Testing/TestResponse.php @@ -1651,7 +1651,7 @@ public function transformNotSuccessfulException($exception) */ protected function appendExceptionToException($exceptionToAppend, $exception) { - $exceptionMessage = $exceptionToAppend->getMessage(); + $exceptionMessage = is_string($exceptionToAppend) ? $exceptionToAppend : $exceptionToAppend->getMessage(); $exceptionToAppend = (string) $exceptionToAppend;