我对控制器的创建功能进行了此测试
public function createTest()
{
$user = factory(App\User::class)->create([
'email' => 'testuser@arabiaweather.com',
'password' => bcrypt($this->password),
'type' => 'admin'
]);
$this->be($user);
$response = $this->call('GET', '/client/1/profile/2/data');
var_dump($response);
$response->assertViewHas('client', 1);
$response->assertViewHas('clientProfile', 2);
$this->visit('/client/1/profile/2/data/create')
->seePageIs('/client/1/profile/2/data/create');
$this->user->delete();
}
我收到了这个错误
Error: Call to undefined method Illuminate\Http\Response::assertViewHas()
我怎么能解决它?