mirror of
https://github.com/pestphp/pest.git
synced 2026-03-12 02:37:22 +01:00
@ -344,12 +344,14 @@ final class Expectation
|
|||||||
|
|
||||||
if (is_object($this->value)) {
|
if (is_object($this->value)) {
|
||||||
if (method_exists($this->value, 'toArray')) {
|
if (method_exists($this->value, 'toArray')) {
|
||||||
$this->value = $this->value->toArray();
|
$array = $this->value->toArray();
|
||||||
} else {
|
} 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.');
|
throw new BadMethodCallException('Expectation value length is not countable.');
|
||||||
|
|||||||
Reference in New Issue
Block a user