public function testChainingSeparatorOverriding() { $foo = new Zend_Controller_Router_Route_Static('foo', array('foo' => 1)); $bar = new Zend_Controller_Router_Route_Static('bar', array('bar' => 2)); $baz = new Zend_Controller_Router_Route_Static('baz', array('baz' => 3)); $chain = $foo->chain($bar, '.'); $res = $chain->match(new Zend_Controller_Router_ChainTest_Request('http://localhost/foo.bar')); $this->assertType('array', $res); $res = $chain->match(new Zend_Controller_Router_ChainTest_Request('http://localhost/foo/bar')); $this->assertEquals(false, $res); $chain->chain($baz, ':'); $res = $chain->match(new Zend_Controller_Router_ChainTest_Request('http://localhost/foo.bar:baz')); $this->assertType('array', $res); }
/** * @group ZF-7368 */ public function testChainingStaticDynamicMatchToParams() { $foo = new Zend_Controller_Router_Route_Static('foo'); $bar = new Zend_Controller_Router_Route(':bar', array('bar' => 1)); $chain = $foo->chain($bar); $request = new Zend_Controller_Router_ChainTest_Request('http://www.zend.com/foo/2'); $res = $chain->match($request); $this->assertTrue(is_array($res), 'Route did not match'); $this->assertEquals(2, $res['bar']); }
public function testAssemblingWithNonFirstHostname() { $this->markTestSkipped('Router features not ready'); $foo = new Zend_Controller_Router_Route_Static('bar'); $bar = new Zend_Controller_Router_Route_Hostname('www.zend.com'); $foo->chain($bar); $this->_router->addRoute('foo-bar', $foo); $this->assertEquals('bar/www.zend.com', $this->_router->assemble(array(), 'foo-bar')); }