4
當我在Laravel Lumen中創建PHPUnit測試用例並調用visit('/')
函數時,PHPUnit始終返回404錯誤代碼。PHPUnit/Lumen始終返回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('/');
}
}
有誰知道我做錯了什麼或如何解決這一問題?
在此先感謝。