From 2289adade227bba65934d9830e4be515b3917ac5 Mon Sep 17 00:00:00 2001 From: Daniel Ang Date: Sat, 28 Aug 2021 17:54:29 +0200 Subject: [PATCH] Use toHaveCount changes to toHaveCount --- src/Expectation.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/Expectation.php b/src/Expectation.php index 5741823f..8f072d57 100644 --- a/src/Expectation.php +++ b/src/Expectation.php @@ -344,14 +344,12 @@ final class Expectation if (is_object($this->value)) { if (method_exists($this->value, 'toArray')) { - $array = $this->value->toArray(); + $this->value = $this->value->toArray(); } else { - $array = (array) $this->value; + $this->value = (array) $this->value; } - Assert::assertCount($number, $array); - - return $this; + return $this->toHaveCount($number); } throw new BadMethodCallException('Expectation value length is not countable.');