nothingworksinc / ticketbeast

Back to the lesson videos:
https://course.testdrivenlaravel.com/lessons
552 stars 11 forks source link

ErrorException : count(): Parameter must be an array or an object that implements Countable #92

Closed ravisharmaa closed 6 years ago

ravisharmaa commented 6 years ago

When going through the lesson Testing Query Scopes. I found this issue. I am using php 7.2, and in a complete trouble regarding this. My configuration is

php 7.2.9 (NTS)-> installed via brew.

The error message when trying to run the test concerts_with_a_published_at_date_are_published

ErrorException : count(): Parameter must be an array or an object that implements Countable
 /Users/ravibastola/Work/ticketbeast/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php:1231
 /Users/ravibastola/Work/ticketbeast/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php:1466
 /Users/ravibastola/Work/ticketbeast/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php:3561
 /Users/ravibastola/Work/ticketbeast/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php:3573
 /Users/ravibastola/Work/ticketbeast/tests/unit/ConcertTest.php:57`
ravisharmaa commented 6 years ago

I found out it to be the L5.3's issue, it can be closed.

svenluijten commented 6 years ago

You can also close the issue yourself @ravisharmaa 🙂

ravisharmaa commented 6 years ago

thanks @svenluijten

adamwathan commented 5 years ago

Just in case anyone else is following along using 5.3 and runs into this issue, the easiest way to get around it is to use the latest unreleased version of Laravel 5.3.

Run this in your terminal:

composer require laravel/framework:5.3.x-dev

...or change your laravel/framework dependency in your composer.json file to 5.3.x-dev.