상속: implements Ergo\Routing\Controller
예제 #1
0
 public function testCustomRoute()
 {
     $urlPath = '/user/24';
     $mockRoute = \Mockery::mock('Erg\\Routing\\Route');
     $mockRoute->shouldReceive('getMatch')->with($urlPath, array())->once()->andReturn(new \Ergo\Routing\RouteMatch('user', array()))->shouldReceive('getName')->andReturn('user');
     $router = new Router();
     $router->connect($mockRoute, 'Custom.view');
     $this->assertEquals($router->lookup($urlPath)->getName(), 'user');
 }
예제 #2
0
 public function testGreedyParametersInRoutes()
 {
     $router = new Routing\Router();
     $router->connect('/fruits/{fruitid}/{blah:greedy}', 'fruit');
     $this->_assertRoute($router, '/fruits/5/this/is/a/test', 'fruit', array('fruitid' => 5, 'blah' => 'this/is/a/test'));
     $this->_assertNoRoute($router, '/blargh');
 }