【发布时间】:2014-12-11 13:52:14
【问题描述】:
我正在尝试使用 Laravel 5 (4.3),并尝试编写一些简单的控制器测试,如下所示:
public function testIndex()
{
$this->call('GET', 'posts');
$this->assertResponseOk();
}
当我运行测试时出现错误:
ErrorException:未定义属性:PostsControllerTest::$client
为什么客户端属性从 Laravel 5 的测试类中消失了?
【问题讨论】:
-
Laravel 5 甚至还没有处于测试阶段。预计事情会随机中断。
标签: php unit-testing laravel-5