feat(toContainEqual): adds method name

This commit is contained in:
Nuno Maduro
2024-01-25 14:38:44 +00:00
parent 15cd7187e9
commit e95c4ee636
2 changed files with 17 additions and 14 deletions

View File

@ -197,18 +197,21 @@ final class Expectation
}
/**
* Asserts that $needle equals an element of the value.
*
* Asserts that $needle equal an element of the value.
*
* @return self<TValue>
*/
public function toContainEquals(mixed ...$needles): self
public function toContainEqual(mixed ...$needles): self
{
if (! is_iterable($this->value)) {
InvalidExpectationValue::expected('iterable');
}
foreach ($needles as $needle) {
if (! is_iterable($this->value)) {
InvalidExpectationValue::expected('iterable');
}
Assert::assertContainsEquals($needle, $this->value);
}
return $this;
}
/**