mirror of
https://github.com/pestphp/pest.git
synced 2026-03-06 07:47:22 +01:00
Add toContainEquals expectation
This commit is contained in:
@ -196,6 +196,21 @@ final class Expectation
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Asserts that $needle equals an element of the value.
|
||||
*
|
||||
* @return self<TValue>
|
||||
*/
|
||||
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.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user