When I create a PHPUnit test case in Laravel Lumen and call a function visit('/'), PHPUnit always returns a 404 error code.
I have the following code to test for strange behavior:
class TestCase extends Laravel\Lumen\Testing\TestCase {
protected $baseUrl = 'https://google.com';
public function createApplication() {
return require __DIR__.'/../bootstrap/app.php';
}
}
class CountryTest extends TestCase {
public function testIndex() {
$this->visit('/');
}
}
Does anyone know what I did wrong or how to fix it?
Thanks in advance.
source
share