错误:调用未定义的方法Illuminate \ Http \ Response :: assertViewHas()

时间:2017-04-24 12:35:10

标签: php laravel unit-testing laravel-5 laravel-5.1

我对控制器的创建功能进行了此测试

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()

我怎么能解决它?

0 个答案:

没有答案