错误:调用未定义的方法phpDocumentor \ Reflection \ Project :: where()

问题描述 投票:1回答:1

做“使用TDD构建laravel应用程序”的Larcast教程,当我添加$response->assertRedirect(Project::where($attributes)->first()->path());

我开始得到以下内容:

错误:调用未定义的方法phpDocumentor \ Reflection \ Project :: where()

我如何解决这个问题,努力在其他任何地方找到解决方案,我已将其添加到laracast教程本身但没有答案。

试图在laracasts网站上追逐答案。

我的测试应该通过。 (功能实际上有效但我希望测试到位以证明它确实如此)

laravel undefined where call laravel-5.8
1个回答
1
投票

你使用错误的导入为Project所以在测试类的顶部放这个:

use App\Project;
© www.soinside.com 2019 - 2024. All rights reserved.