I have a group for api:
Route::group(array('prefix' => 'api'), function () {
Route::get('abc', function () {
return 'abc';
});
);
But, when testing use $this->call('GET', '/api/abc)
or $this->call('GET', 'path_to_abc')
, I always get 404 error, although I've printed the url and I can visit that link on browser
If you haven't configured your TestCase.php
file, you need to set your app url there as
File: TestCase.php
/**
* The base URL to use while testing the application.
*
* @var string
*/
protected $baseUrl = 'http://YOUR_APP_URL';