public function testFromGlobals() { $superGlobalRequest = Request::fromGlobals(); $this->assertNotNull($superGlobalRequest); $this->assertInstanceOf("oscarpalmer\\Shelf\\Request", $superGlobalRequest); session_destroy(); }
/** * 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(); }