Exemplo n.º 1
0
 public function testRouteWithId()
 {
     $mux = new \Pux\Mux();
     $mux->add('/hello/:name', ['HelloController2', 'indexAction'], ['id' => 'hello-name']);
     $mux->add('/foo', ['HelloController2', 'indexAction'], ['id' => 'foo']);
     ok($mux->routesById);
     ok($mux->routesById['foo']);
     $r = $mux->getRoute('foo');
     ok($r, 'should return foo route');
     ok($mux->getRoute('hello-name'), 'should return hello-name route');
 }