0
嗨,我想设置一个测试来测试我的数据库调用。我想通过在URL中的变量,但似乎无法让它的工作。Laravel - 单元测试
我想做到这一点
public function testDb()
{
$response = $this->call('GET', '/searchAvailability?keyword=test product');
$content = $response->getContent();
$this->assertEquals('[{"name":"test product"}]',$content);
}
但一直收到“未定义的变量:关键字”当我尝试。它运行在浏览器中,而不是当我运行phpunit时。任何人都有任何想法,为什么这不工作谢谢。