From b3d3b4485d9a008676c154f9399c5c13ac183804 Mon Sep 17 00:00:00 2001 From: Andrea Marco Sartori Date: Sun, 16 Jan 2022 22:32:20 +1000 Subject: [PATCH] Do not nest expectations --- src/Expectation.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Expectation.php b/src/Expectation.php index f98638f7..8dc287a0 100644 --- a/src/Expectation.php +++ b/src/Expectation.php @@ -56,7 +56,7 @@ final class Expectation */ public function and(mixed $value): Expectation { - return new self($value); + return $value instanceof static ? $value : new self($value); } /**