因此,正如我在标题中所述,我正在开发 Laravel 5.7 项目,并在此应用程序(大系统)中进行首次测试。我们还没有在这里进行任何测试,所以这个问题是第一次在这里。
对于每个测试,这就是控制器使用特征的方式
use RefreshDatabase;
protected function setUp()
{
parent::setUp();
$this->withoutMiddleware(\App\Http\Middleware\VerifyCsrfToken::class);
$this->withoutExceptionHandling();
}
如您所见,我只是尝试在测试完成后使用该特征来刷新数据库。
当我调用执行测试时,问题就出现了。
ErrorException:尝试访问 int 类型值的数组偏移量
C:\larragon\www\demi\systems\damaro endor\symfon