[HttpClient] add missing test case

This commit is contained in:
Nicolas Grekas 2019-03-10 23:05:13 +01:00
parent a96308f0ba
commit f54c89c530
1 changed files with 15 additions and 0 deletions

View File

@ -399,6 +399,21 @@ abstract class HttpClientTestCase extends TestCase
$this->assertSame('http://localhost:8057/post', $steps[0][2]['url']);
}
public function testPostJson()
{
$client = $this->getHttpClient();
$response = $client->request('POST', 'http://localhost:8057/post', [
'json' => ['foo' => 'bar'],
]);
$body = $response->toArray();
$this->assertContains('json', $body['content-type']);
unset($body['content-type']);
$this->assertSame(['foo' => 'bar', 'REQUEST_METHOD' => 'POST'], $body);
}
public function testPostArray()
{
$client = $this->getHttpClient();