Call to a member function connection() on a non-object error on Laravel 5

后端 未结 3 1293
再見小時候
再見小時候 2021-02-02 01:05

I want to store user configuration data on database and I\'m following this forum thread about it http://forumsarchive.laravel.io/viewtopic.php?id=10406 but when I implemented i

3条回答
  •  余生分开走
    2021-02-02 01:41

    While running TestCase in Laravel 6.x and above, I often encounter this error. I realized that the unit test is extended from PHPUnit TestClass rather than Laravel TestCase. So change PHPUnit\Framework\TestCase; to Tests\TestCase.

提交回复
热议问题