コード例 #1
0
ファイル: HttpClientTest.php プロジェクト: im286er/windwalker
 /**
  * Method to test patch().
  *
  * @return void
  *
  * @covers Windwalker\Http\HttpClient::patch
  */
 public function testPatch()
 {
     $url = 'http://example.com/?foo=bar';
     $data = array('flower' => 'sakura');
     $headers = array('X-Foo' => 'Bar');
     $this->instance->patch($url, $data, $headers);
     $this->assertEquals('PATCH', $this->transport->request->getMethod());
     $this->assertEquals($url, $this->transport->request->getRequestTarget());
     $this->assertEquals('Bar', $this->transport->request->getHeaderLine('X-Foo'));
     $this->assertEquals(UriHelper::buildQuery($data), $this->transport->request->getBody()->__toString());
 }