PHPUnit / Lumen always returns 404

Wednesday, November 4, 2015

When I create a PHPUnit test case in Laravel Lumen and call the visit('/') function, PHPUnit always returns a 404 error code.



I have the following code to test the weird behavior:



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('/');
}
}


Does anyone know what I did wrong or how to fix this?



Thanks in advance.

0 comments:

Post a Comment