Ejemplo n.º 1
0
 public function testmethod()
 {
     $_SERVER['HTTP_X_HTTP_METHOD_OVERRIDE'] = 'DELETE';
     $request = new Request();
     $this->assertEquals('DELETE', $request->method());
     $this->assertEquals('GET', $request->method(true));
     Config::set('var_method', '_method');
     $_POST['_method'] = 'POST';
     $request = new Request();
     $this->assertEquals('POST', $request->method());
     $this->assertEquals('GET', $request->method(true));
     $this->assertTrue($request->isPost());
     $this->assertFalse($request->isGet());
     $this->assertFalse($request->isPut());
     $this->assertFalse($request->isDelete());
     $this->assertFalse($request->isHead());
     $this->assertFalse($request->isPatch());
     $this->assertFalse($request->isOptions());
 }