/** * Test HTTP POST method detection */ public function testIsPost() { $env = \Slim\Environment::mock(array('REQUEST_METHOD' => 'POST')); $req = new \Slim\Http\Request($env); $this->assertTrue($req->isPost()); }
/** * Test HTTP HEAD method detection */ public function testIsHead() { $env = \Slim\Environment::mock(array('REQUEST_METHOD' => 'HEAD')); $req = new \Slim\Http\Request($env); $this->assertFalse($req->isGet()); $this->assertFalse($req->isPost()); $this->assertFalse($req->isPut()); $this->assertFalse($req->isDelete()); $this->assertFalse($req->isOptions()); $this->assertTrue($req->isHead()); }