diff --git a/src/Mixins/Expectation.php b/src/Mixins/Expectation.php index e42fc96a..4473f553 100644 --- a/src/Mixins/Expectation.php +++ b/src/Mixins/Expectation.php @@ -196,6 +196,21 @@ final class Expectation return $this; } + /** + * Asserts that $needle equals an element of the value. + * + * @return self + */ + public function toContainEquals(mixed ...$needles): self + { + foreach ($needles as $needle) { + if (! is_iterable($this->value)) { + InvalidExpectationValue::expected('iterable'); + } + Assert::assertContainsEquals($needle, $this->value); + } + } + /** * Asserts that the value starts with $expected. *