InterNations\Component\HttpMock\Tests\PHPUnit\HttpMockPHPUnitIntegrationTest::testPutRequest PHP Method

testPutRequest() public method

public testPutRequest ( )
    public function testPutRequest()
    {
        $this->http->mock->when()->methodIs('PUT')->then()->body('BODY')->statusCode(201)->header('X-Foo', 'Bar')->end();
        $this->http->setUp();
        $response = $this->http->client->put('/', ['x-client-header' => 'header-value'], ['put-key' => 'put-value'])->send();
        $this->assertSame('BODY', $response->getBody(true));
        $this->assertSame(201, $response->getStatusCode());
        $this->assertSame('Bar', (string) $response->getHeader('X-Foo'));
        $this->assertSame('put-value', $this->http->requests->latest()->getPostField('put-key'));
    }