lundi 5 janvier 2015

symfony component httpkernel exception notfoundhttpexception unit test laravel 4

I'm facing this error in unit test, here is my testing code:



public function testBlogRoute()
{
$this->call('GET', 'blog');
$this->assertTrue($this->client->getResponse()->isOk());
}


and this is my routes file:



Route::get('blog', function(){
return 'hello';
});


Route::group(['prefix' => Config::get('blog::main_route'),'namespace' => 'Mockie\\Blog\\Controllers'], function(){

Route::resource('categories', 'CategoriesController');

});


I tried debug Route::getRoutes() in unit test but it was return empty.


This is only happen in unit test, because I can access the route from browser http://localhost:8000/blog and it works well. and when I tried debug Route::getRoutes() in browsers or using php artisan routes the output looks fine (I mean, I can see the route that I want to test).


I want to provide you more code of mine but I'm not sure which part I should attach here, if you want to see any code of mine please tell me which part, I'd like to attach it here.


Aucun commentaire:

Enregistrer un commentaire