public function testChainingWorksWithWildcardAndOneParameter() { $foo = new Route\Hostname('www.zend.com', array('module' => 'simple', 'controller' => 'foo', 'action' => 'bar')); $bar = new Route\Route(':controller/:action/*', array('controller' => 'index', 'action' => 'index')); $chain = $foo->addChain($bar); $request = new Request('http://www.zend.com/foo/bar/id/12'); $res = $chain->match($request); $this->assertEquals('simple', $res['module']); $this->assertEquals('foo', $res['controller']); $this->assertEquals('bar', $res['action']); }
public function testAssemblingWithHostnameWithChainHTTP() { $foo = new Route\Hostname('www.zend.com'); $bar = new Route\StaticRoute('bar'); $chain = $foo->addChain($bar); $this->_router->addRoute('foo-bar', $chain); $this->assertEquals('http://www.zend.com/bar', $this->_router->assemble(array(), 'foo-bar')); }