From ebcd63249877a7c2f4f5f173a4d2800a6cfcee6c Mon Sep 17 00:00:00 2001 From: Dries Vints Date: Mon, 29 Nov 2021 15:37:02 +0100 Subject: [PATCH 1/2] Fix seeJson with null data --- src/Concerns/MakesHttpRequests.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/Concerns/MakesHttpRequests.php b/src/Concerns/MakesHttpRequests.php index 4ba05fd..17847fa 100644 --- a/src/Concerns/MakesHttpRequests.php +++ b/src/Concerns/MakesHttpRequests.php @@ -420,11 +420,12 @@ public function seeJson(array $data = null, $negate = false) if (is_null($data)) { $decodedResponse = json_decode($this->response->getContent(), true); - if (is_null($decodedResponse) || $decodedResponse === false) { - PHPUnit::fail( - "JSON was not returned from [{$this->currentUri}]." - ); - } + $this->assertTrue( + ! is_null($decodedResponse) && $decodedResponse !== false, + "JSON was not returned from [{$this->currentUri}]." + ); + + return $this; } try { From 721e1e87e4493de31a6b023d7b50c2ce8de4963d Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Mon, 29 Nov 2021 14:37:28 +0000 Subject: [PATCH 2/2] Apply fixes from StyleCI --- src/Concerns/MakesHttpRequests.php | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Concerns/MakesHttpRequests.php b/src/Concerns/MakesHttpRequests.php index 17847fa..73bbb81 100644 --- a/src/Concerns/MakesHttpRequests.php +++ b/src/Concerns/MakesHttpRequests.php @@ -6,7 +6,6 @@ use Illuminate\Http\Request; use Illuminate\Http\UploadedFile; use Illuminate\Support\Str; -use Illuminate\Testing\Assert as PHPUnit; use Laravel\BrowserKitTesting\TestResponse; use PHPUnit\Framework\ExpectationFailedException; use Symfony\Component\HttpFoundation\File\UploadedFile as SymfonyUploadedFile;