Beispiel #1
0
 /**
  * Test fetch PATCH params
  */
 public function testPatch()
 {
     $env = \Slim\Environment::mock(array('REQUEST_METHOD' => 'PATCH', 'slim.input' => 'foo=bar&abc=123', 'CONTENT_TYPE' => 'application/x-www-form-urlencoded', 'CONTENT_LENGTH' => 15));
     $req = new \Slim\Http\Request($env);
     $this->assertEquals(2, count($req->patch()));
     $this->assertEquals('bar', $req->patch('foo'));
     $this->assertEquals('bar', $req->params('foo'));
     $this->assertNull($req->patch('xyz'));
     $this->assertFalse($req->patch('xyz', false));
 }