0
我只想获取链接(路径)的状态码。Laravel 5 | PHPUnit测试错误
[我使用验证过]
我的输入:
public function testPath()
{
$this->withoutMiddleware();
$this->call('GET', '/admin/create');
$this->assertResponseStatus(200);
}
即使我检查这个浏览器上,我得到应有的回应。 但在PHPUnit的测试,我得到以下错误...
1) ItemsTest::testPath
Expected status code 200, got 500.
Failed asserting that 500 matches expected 200
什么是错我的测试代码...?
尝试'$这个 - >访问( '/管理/创建');'而不是'$这个 - >调用( 'GET','/admin/create');' –
K ...那么我怎样才能检查它的状态码...... –
$ cont = $ this-> visit('/ admin/create'); $ cont-> assertResponseOk(); 我得到同样的错误... –