From a0b4f5472953ccadb4b54a39dfd6695dff5d3dcd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=93=AD=E6=98=95?= <715557344@qq.com> Date: Wed, 29 Nov 2023 11:44:48 +0800 Subject: [PATCH] Upgrade docs for v3.1 (#6335) Co-authored-by: zxyfaxcn Co-authored-by: Lu Fei <52o@qq52o.cn> --- src/Http/TestResponse.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Http/TestResponse.php b/src/Http/TestResponse.php index 4bd3c75..792c724 100644 --- a/src/Http/TestResponse.php +++ b/src/Http/TestResponse.php @@ -549,9 +549,10 @@ public function decodeResponseJson() $decodedResponse = $testJson->json(); if (is_null($decodedResponse) || $decodedResponse === false) { - if ($this->exception ?? null) { - throw $this->exception; - } + $exception = $this->exception ?? null; + + $exception && throw $exception; + PHPUnit::fail('Invalid JSON was returned from the route.'); }