Example #1
0
 /**
  * Router::cacheNamedRoute should throw na exception if named Route
  * with same name already exists.
  */
 public function testNamedRouteWithExistingName()
 {
     $this->setExpectedException('RuntimeException');
     $request = new Request();
     $router = new Router($request);
     $route1 = $router->map('/foo/bar', function () {
     }, 'GET');
     $route2 = $router->map('/foo/bar/2', function () {
     }, 'GET');
     $router->cacheNamedRoute('bar', $route1);
     $router->cacheNamedRoute('bar', $route2);
 }