From 4720e0655b0fe8a787a6032b15cd1d244b1a15cf Mon Sep 17 00:00:00 2001 From: Nuno Maduro Date: Fri, 21 Jan 2022 16:48:26 +0000 Subject: [PATCH] Revert "Fixes `json` in Higher Order Expectations" --- src/HigherOrderExpectation.php | 5 ----- tests/.snapshots/success.txt | 3 +-- tests/Features/Expect/HigherOrder/methods.php | 11 ----------- 3 files changed, 1 insertion(+), 18 deletions(-) diff --git a/src/HigherOrderExpectation.php b/src/HigherOrderExpectation.php index 1e7155c7..e436da0c 100644 --- a/src/HigherOrderExpectation.php +++ b/src/HigherOrderExpectation.php @@ -77,11 +77,6 @@ final class HigherOrderExpectation return $this->expect($value); } - public function json(): HigherOrderExpectation - { - return new self($this->original, $this->expectation->json()->value); - } - /** * Dynamically calls methods on the class with the given arguments. * diff --git a/tests/.snapshots/success.txt b/tests/.snapshots/success.txt index 03ffdd4d..0c6a57ab 100644 --- a/tests/.snapshots/success.txt +++ b/tests/.snapshots/success.txt @@ -124,7 +124,6 @@ ✓ it can compose complex expectations ✓ it can handle nested method calls ✓ it works with higher order tests - ✓ it can call the json method in higher order expectations PASS Tests\Features\Expect\HigherOrder\methodsAndProperties ✓ it can access methods and properties @@ -721,5 +720,5 @@ ✓ it is a test ✓ it uses correct parent class - Tests: 4 incompleted, 9 skipped, 479 passed + Tests: 4 incompleted, 9 skipped, 478 passed \ No newline at end of file diff --git a/tests/Features/Expect/HigherOrder/methods.php b/tests/Features/Expect/HigherOrder/methods.php index c85917b5..d6da636b 100644 --- a/tests/Features/Expect/HigherOrder/methods.php +++ b/tests/Features/Expect/HigherOrder/methods.php @@ -74,19 +74,8 @@ it('works with higher order tests') ->name()->toEqual('Has Methods') ->books()->each->toBeArray; -it('can call the json method in higher order expectations', function () { - expect(new HasMethods()) - ->getJsonContent()->json()->id->toBe(1)->toBeGreaterThan(0) - ->getJsonContent()->json()->email->toBe('foo@bar.com'); -}); - class HasMethods { - public function getJsonContent(): string - { - return '{"id":1,"username":"dan","email":"foo@bar.com"}'; - } - public function name() { return 'Has Methods';