Beispiel #1
0
 /**
  * Test if named route exists
  *
  * Pre-conditions:
  * Slim app instantiated;
  * Named route created;
  *
  * Post-conditions:
  * Named route found to exist;
  * Non-existant route found not to exist;
  */
 public function testHasNamedRoute()
 {
     $router = new \Slim\Router();
     $router->setResourceUri($this->req->getResourceUri());
     $route = $router->map('/foo', function () {
     })->via('GET');
     $router->addNamedRoute('foo', $route);
     $this->assertTrue($router->hasNamedRoute('foo'));
     $this->assertFalse($router->hasNamedRoute('bar'));
 }