From 0c84c1b1b66b11dff08c55d0baf49eead5e77eb5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9gory=20Planchat?= Date: Tue, 14 Nov 2023 09:58:42 +0100 Subject: [PATCH] Fixing PHPSpec --- spec/ComplexResultBucketSpec.php | 50 +++++++++++++++++++++- spec/IteratorRejectionResultBucketSpec.php | 8 +++- spec/RejectionResultBucketSpec.php | 9 +++- 3 files changed, 64 insertions(+), 3 deletions(-) diff --git a/spec/ComplexResultBucketSpec.php b/spec/ComplexResultBucketSpec.php index 48a7111..bc25e58 100644 --- a/spec/ComplexResultBucketSpec.php +++ b/spec/ComplexResultBucketSpec.php @@ -27,9 +27,11 @@ function it_has_non_empty_acceptance() new \stdClass() ), new RejectionResultBucket( + 'Lorem ipsum dolor sit amet', + new \Exception('Lorem ipsum dolor sit amet'), + new \stdClass(), new \stdClass(), new \stdClass(), - new \stdClass() ), new AcceptanceResultBucket( new \stdClass() @@ -50,6 +52,16 @@ public function walkRejection(): iterable new \stdClass() ]; } + + public function reasons(): ?array + { + return null; + } + + public function exceptions(): ?array + { + return null; + } }, new class implements AcceptanceResultBucketInterface, RejectionResultBucketInterface { public function walkAcceptance(): iterable @@ -77,6 +89,16 @@ public function getIterator(): \Traversable } }; } + + public function reasons(): ?array + { + return null; + } + + public function exceptions(): ?array + { + return null; + } } ); @@ -87,6 +109,8 @@ function it_has_non_empty_rejection() { $this->beConstructedWith( new RejectionResultBucket( + 'Lorem ipsum dolor sit amet', + new \Exception('Lorem ipsum dolor sit amet'), new \stdClass(), new \stdClass() ), @@ -96,6 +120,8 @@ function it_has_non_empty_rejection() new \stdClass() ), new RejectionResultBucket( + 'Lorem ipsum dolor sit amet', + new \Exception('Lorem ipsum dolor sit amet'), new \stdClass() ), new class implements AcceptanceResultBucketInterface, RejectionResultBucketInterface { @@ -114,6 +140,16 @@ public function walkRejection(): iterable new \stdClass() ]; } + + public function reasons(): ?array + { + return null; + } + + public function exceptions(): ?array + { + return null; + } }, new class implements AcceptanceResultBucketInterface, RejectionResultBucketInterface { public function walkAcceptance(): iterable @@ -141,6 +177,16 @@ public function getIterator(): \Traversable } }; } + + public function reasons(): ?array + { + return null; + } + + public function exceptions(): ?array + { + return null; + } } ); @@ -162,6 +208,8 @@ function it_can_accept_values() function it_can_reject_values() { $this->reject( + 'Lorem ipsum dolor sit amet', + new \Exception('Lorem ipsum dolor sit amet'), new \stdClass(), new \stdClass(), new \stdClass() diff --git a/spec/IteratorRejectionResultBucketSpec.php b/spec/IteratorRejectionResultBucketSpec.php index 3d94d2f..7b78c45 100644 --- a/spec/IteratorRejectionResultBucketSpec.php +++ b/spec/IteratorRejectionResultBucketSpec.php @@ -11,7 +11,11 @@ class IteratorRejectionResultBucketSpec extends ObjectBehavior { function it_is_initializable() { - $this->beConstructedWith(new \EmptyIterator()); + $this->beConstructedWith( + 'Lorem ipsum dolor sit amet', + new \Exception('Lorem ipsum dolor sit amet'), + new \EmptyIterator() + ); $this->shouldHaveType(IteratorRejectionResultBucket::class); $this->shouldBeAnInstanceOf(RejectionResultBucketInterface::class); @@ -20,6 +24,8 @@ function it_is_initializable() function it_has_non_empty_rejection() { $this->beConstructedWith( + 'Lorem ipsum dolor sit amet', + new \Exception('Lorem ipsum dolor sit amet'), new \ArrayIterator([ new \stdClass(), new \stdClass(), diff --git a/spec/RejectionResultBucketSpec.php b/spec/RejectionResultBucketSpec.php index a2018dd..c8f508e 100644 --- a/spec/RejectionResultBucketSpec.php +++ b/spec/RejectionResultBucketSpec.php @@ -11,6 +11,11 @@ class RejectionResultBucketSpec extends ObjectBehavior { function it_is_initializable() { + $this->beConstructedWith( + 'Lorem ipsum dolor sit amet', + new \Exception('Lorem ipsum dolor sit amet'), + ); + $this->shouldHaveType(RejectionResultBucket::class); $this->shouldBeAnInstanceOf(RejectionResultBucketInterface::class); } @@ -18,9 +23,11 @@ function it_is_initializable() function it_has_non_empty_rejection() { $this->beConstructedWith( + 'Lorem ipsum dolor sit amet', + new \Exception('Lorem ipsum dolor sit amet'), + new \stdClass(), new \stdClass(), new \stdClass(), - new \stdClass() ); $this->walkRejection()->shouldHaveCount(3);