$request =
$this->
setRequestBody($request,
$params);
// Initialize the RouteCollection
if (!
$routes =
$this->routes
) { $routes = Services::
routes()->
loadRoutes();
} $routes->
setHTTPVerb($method);
// Make sure any other classes that might call the request
// instance get the right one.
Services::
injectMock('request',
$request);
// Make sure filters are reset between tests
Services::
injectMock('filters', Services::
filters(null, false
));
// Make sure validation is reset between tests
Services::
injectMock('validation', Services::
validation(null, false
));
$response =
$this->app
->
setContext('web'
) ->
setRequest($request) ->
run($routes, true
);