/** * handle the request * @return mixed */ public function handle() { $method = $this->getMeta() ? 'handleMeta' : static::$verb_method_map[$this->request->getMethod()]; return $this->{$method}($this->getModelClass($this->getModelName()), $this->getModelId()); }
/** * @backupGlobals enabled */ public function testGlobalImportethodReadsExpectedValues() { $args = $_REQUEST = ['testing' => 'true']; $params = new PublicObject($args); $_SERVER['REQUEST_URI'] = '/index?test'; $uri = '/index'; $port = $_SERVER['SERVER_PORT'] = '8080'; $method = $_SERVER['REQUEST_METHOD'] = Verb::POST; $req = new Request(); $req->importFromGlobals(); $this->assertEquals($params, $req->getParameters()); $this->assertEquals($uri, $req->getUri()); $this->assertEquals($port, $req->getPort()); $this->assertEquals($method, $req->getMethod()); }