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