I'm using hostname routes to direct requests to the appropriate modules, so clients.xxx.com routes to the clients module. Now I'm trying to create some phpunit tests and I'm not sure how to dispatch to the proper module?
I've circumvented this issue by adding the default routes onto the router in the test case. Say you wanted to test the foo module, index controller, index action.
/**
* @test
*/
public function indexAction()
{
$frontController = $this->getFrontController();
$router = $frontController->getRouter();
$router->addDefaultRoutes();
$this->dispatch('foo/index/index');
}
You could add the default routes in the setup method to prevent repeating the code.