~Laravel ~Fix | How to fix
Call to a member function connection() on null error on Laravel >=6.x
I decided to spin up a fresh Laravel 8 installation to do some practicing on.
I noticed that if you run
php artisan test all tests pass out of the box. This is a little strange to me, I feel that you should start with a failing test.
So I decided to go into the example unit test and modify it so it will NOT PASS!
My idea was simple, I am going to pull in the
User model and assert that there should be 1 user there. This test should not pass. I did however run the migrations.