Laravel 5 Unit Test - Call to a member function connection() on null

前端 未结 7 1308
灰色年华
灰色年华 2020-12-31 06:53

I tried creating a unit test for the relationships between my User and Shop models, however when I run vendor\\\\bin\\\\phpunit this e

7条回答
  •  遥遥无期
    2020-12-31 07:18

    First of all, setUp() is called before every test, so you shouldn't call it from within the constructor

    Second of all, you should call the parent::setUp() in your setUp() to initialize the app instance.

提交回复
热议问题