Example #1
0
 public function testCase011()
 {
     $this->request->setRequestUri('/subdir/ap/1.2/name/value');
     $this->request->setBaseUri('/subdir');
     $route = new Yaf_Route_Rewrite("/subdir/:name/:version", array("action" => "version"));
     $this->router->addRoute("subdir", $route)->addRoute("ap", new Yaf_Route_Rewrite("/ap/:version/*", array("action" => 'ap')))->route($this->request);
     $this->assertEquals('ap', $this->router->getCurrentRoute());
     $this->assertEquals('1.2', $this->request->getParam('version'));
     $this->assertEquals('ap', $this->request->getActionName());
     $this->assertEquals(null, $this->request->getControllerName());
     $this->assertEquals('value', $this->request->getParam('name'));
 }