Amp\ArtaxTest\ClientHttpBinIntegrationTest::testPutStringBody PHP Method

testPutStringBody() public method

public testPutStringBody ( )
    public function testPutStringBody()
    {
        $uri = 'http://httpbin.org/put';
        $client = new Client();
        $body = 'zanzibar';
        $request = (new Request())->setUri($uri)->setMethod('PUT')->setBody($body);
        $promise = $client->request($request);
        $response = \Amp\wait($promise);
        $this->assertInstanceOf('Amp\\Artax\\Response', $response);
        $result = json_decode($response->getBody());
        $this->assertEquals($body, $result->data);
    }