【发布时间】:2014-03-19 17:05:23
【问题描述】:
我正在尝试使用 PHPUnit 为 Laravel 运行单元测试。
我对函数的调用似乎到达了控制器,但是,它们似乎绕过了我的过滤器。过滤器用于进行用户验证、会话令牌等。该调用似乎直接转到控制器并忘记了过滤器。
public function testBasicExample(){
$response = $this->call('GET', 'URL_Here', array('param_1' => 'value_1', 'param_2' => 'value_2' ));
echo $response->getContent(); /**This should not be returning true if values are wrong and it is **/
$this->assertTrue($this->client->getResponse()->isOk());
}
有什么想法吗?
【问题讨论】:
标签: php unit-testing laravel-4 phpunit