Example #1
0
 /**
  * Test HTTP GET method detection
  */
 public function testIsGet()
 {
     $env = \Slim\Environment::mock(array('REQUEST_METHOD' => 'GET'));
     $req = new \Slim\Http\Request($env);
     $this->assertTrue($req->isGet());
 }
Example #2
0
 /**
  * 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());
 }