コード例 #1
0
ファイル: RouterTest.php プロジェクト: alanvivona/scawTP
 /**
  * Router::cacheNamedRoute should throw na exception if named Route
  * with same name already exists.
  */
 public function testNamedRouteWithExistingName()
 {
     $this->setExpectedException('RuntimeException');
     $request = new Slim_Http_Request();
     $router = new Slim_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);
 }