하나의 컨트롤러 메서드에 대해 간단한 단위 테스트를 설정하려고합니다.Laravel 5.5 단위 테스트 컨트롤러 방법
목표는보기에 예상 값이 있는지 테스트하는 것입니다. 나는 다음과 같은 오류 얻을 내 conosle에서
/**
* Does the homepage receive all companies when there is no licensekey provided.
*
* @return void
*/
public function testAllCompaniesOnHomepageWithoutLicensekey()
{
$this->call('GET', '/');
$allCompanies = Company::all();
$this->assertViewHas('allCompanies', $allCompanies);
}
:이 Laravel 5.5에서 더 이상 availbale 경우
Error: Call to undefined method Tests\Unit\ExampleTest::assertViewHas()
을 나는 확실하지 않다하지?
누구나 내 목표를 테스트 할 수 있습니다.
@Troyer 내가 볼 수 없습니다. 나는 browsertests를하려고하지 않고있다. – Chris