mirror of
https://github.com/pestphp/pest.git
synced 2026-03-06 15:57:21 +01:00
@ -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.');
|
||||
|
||||
Reference in New Issue
Block a user