Do not nest expectations

This commit is contained in:
Andrea Marco Sartori
2022-01-16 22:32:20 +10:00
parent 108fe45164
commit b3d3b4485d

View File

@ -56,7 +56,7 @@ final class Expectation
*/ */
public function and(mixed $value): Expectation public function and(mixed $value): Expectation
{ {
return new self($value); return $value instanceof static ? $value : new self($value);
} }
/** /**