Example #1
0
 /**
  * Create a new Quest object from an array of routes and Shelf objects;
  * parameters are optional.
  *
  * @param array    $routes   Array of routes.
  * @param Request  $request  Shelf Request object.
  * @param Response $response Shelf Response object.
  */
 public function __construct(array $routes = array(), Request $request = null, Response $response = null)
 {
     $this->errors = array();
     $this->filters = array("after" => array(), "before" => array());
     $this->routes = $routes;
     $this->request = $request ?: Request::fromGlobals();
     $this->response = $response ?: new Response();
 }
Example #2
0
 public function testIsVerb()
 {
     $request = new Request($this->request);
     $this->assertFalse($request->isDelete());
     $this->assertTrue($request->isGet());
     $this->assertFalse($request->isHead());
     $this->assertFalse($request->isPost());
     $this->assertFalse($request->isPut());
     session_destroy();
 }