/** * @expectedException Exception */ public function testFailGenerate() { list($route1, $route2, $route3, $route4) = $this->getRoutes(); $collection = new RouteCollection(); $collection->attachRoute($route2); $router = new Router($collection); $router->match("/foo1/xujiajun", 'GET'); $url = $router->generate('say_hello', ['xujiajun']); $this->assertEquals($url, '/hello/xujiajun'); }