Revert "Use toHaveCount"

This reverts commit 2289adade2.
This commit is contained in:
Daniel Ang
2021-08-28 18:14:55 +02:00
parent 2289adade2
commit 4f386894bd

View File

@ -344,12 +344,14 @@ final class Expectation
if (is_object($this->value)) {
if (method_exists($this->value, 'toArray')) {
$this->value = $this->value->toArray();
$array = $this->value->toArray();
} else {
$this->value = (array) $this->value;
$array = (array) $this->value;
}
return $this->toHaveCount($number);
Assert::assertCount($number, $array);
return $this;
}
throw new BadMethodCallException('Expectation value length is not countable.');