Amp\ArtaxTest\ClientHttpBinIntegrationTest::testClientAddsZeroContentLengthHeaderForEmptyBodiesOnPost PHP Method

testClientAddsZeroContentLengthHeaderForEmptyBodiesOnPost() public method

    public function testClientAddsZeroContentLengthHeaderForEmptyBodiesOnPost()
    {
        $uri = 'http://httpbin.org/post';
        $client = new Client();
        $request = (new Request())->setUri($uri)->setMethod('POST');
        $promise = $client->request($request);
        $response = \Amp\wait($promise);
        $this->assertInstanceOf('Amp\\Artax\\Response', $response);
        $body = $response->getBody();
        $result = json_decode($body);
        $this->assertEquals('0', $result->headers->{'Content-Length'});
    }