예제 #1
0
 public function testWithModules()
 {
     $request = new Zend_Controller_RouterTest_Request('http://framework.zend.com/module/controller/action/var/value');
     $router = new Zend_Controller_Router();
     $router->setParam('useModules', true);
     $route = $router->route($request);
     $this->assertEquals('module', $request->getModuleName());
     $this->assertEquals('controller', $request->getControllerName());
     $this->assertEquals('action', $request->getActionName());
     $this->assertEquals('value', $request->getParam('var'));
 }
예제 #2
0
 /**
  * testRoute 
  */
 public function testRoute()
 {
     $request = new Zend_Controller_RouterTest_Request();
     $router = new Zend_Controller_Router();
     $route = $router->route($request);
     $this->assertEquals('foo', $route->getControllerName(), $request->getPathInfo());
     $this->assertEquals('bar', $route->getActionName(), $request->getPathInfo());
     $params = $route->getParams();
     $this->assertTrue(isset($params['baz']), $request->getPathInfo());
     $this->assertEquals(2, $params['baz'], $request->getPathInfo());
 }