function testMethodOverride() { $req = new Request(); $req->mock(array("REQUEST_METHOD" => "POST", "HTTP_X_HTTP_METHOD_OVERRIDE" => "PUT")); $this->assertEquals("PUT", $req->getMethod()); $this->assertEquals("POST", $req->getOriginalMethod()); }
/** * Responds to the client to confirm method not allowed. * * @param \stdClass $match * @return void */ protected function routeToNotAllowed($match) { $status = $this->request->getMethod() === "OPTIONS" ? 200 : 405; $this->response->setHeader("Allow", join(", ", $match->allowed)); $this->response->setStatus($status); }