From ecb37fce91d6ddcf55bf9d5d6c4176127340ad35 Mon Sep 17 00:00:00 2001 From: Daniel Ang Date: Fri, 18 Jun 2021 13:04:31 +0200 Subject: [PATCH] Refactoring to use toBeJson() Refactoring according to @lukeraymonddowning suggestion --- src/Expectation.php | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/Expectation.php b/src/Expectation.php index 3c238805..e2d6369b 100644 --- a/src/Expectation.php +++ b/src/Expectation.php @@ -65,10 +65,7 @@ final class Expectation */ public function json(): Expectation { - Assert::assertIsString($this->value); - Assert::assertJson($this->value); - - return new self(json_decode($this->value, true)); + return $this->toBeJson()->and(json_decode($this->value, true)); } /**