public function testHostnameRegexRouter()
{
$this->specify('The Router::getControllerName does not return correct controller by using regexp in host name', function ($hostname, $expected) {
$router = $this->getRouter(false);
$router->add('/edit', ['controller' => 'posts3', 'action' => 'edit3']);
$router->add('/edit', ['controller' => 'posts', 'action' => 'edit'])->setHostname('([a-z]+).phalconphp.com');
$router->add('/edit', ['controller' => 'posts2', 'action' => 'edit2'])->setHostname('mail.([a-z]+).com');
$router->add('/edit', ['controller' => 'posts4', 'action' => 'edit2'])->setHostname('([a-z]+).([a-z]+).net');
$_SERVER['HTTP_HOST'] = $hostname;
$router->handle('/edit');
expect($router->getControllerName())->equals($expected);
}, ['examples' => $this->hostnameRegexProvider()]);
}