【发布时间】:2016-02-04 18:32:52
【问题描述】:
当我在 Laravel Lumen 中创建 PHPUnit 测试用例并调用 visit('/') 函数时,PHPUnit 总是返回 404 错误代码。
我有以下代码来测试奇怪的行为:
class TestCase extends Laravel\Lumen\Testing\TestCase {
protected $baseUrl = 'https://google.com'; // this used to be my own url but even this doesn't work.
public function createApplication() {
return require __DIR__.'/../bootstrap/app.php';
}
}
class CountryTest extends TestCase {
public function testIndex() {
$this->visit('/');
}
}
有谁知道我做错了什么或如何解决这个问题?
提前致谢。
【问题讨论】: