public function testRequestBodyIsNotEmptyAfterQueryIsChanged() { $orgRequest = new Request('POST', '', [], 'body_data'); $transportRequest = new GuzzleTransportRequest($orgRequest); $transportRequest->setQueryParams(['a' => 'b']); $this->assertEquals('body_data', (string) $transportRequest->getWrappedRequest()->getBody()); }
public function testSetterMethodsArePipedToWrappedRequestSetQuery() { $fixtureQuery = ['size' => 5]; $orgRequest = $this->getMockBuilder('Psr\\Http\\Message\\RequestInterface')->disableOriginalConstructor()->getMock(); $uri = $this->getMockBuilder('Psr\\Http\\Message\\UriInterface')->disableOriginalConstructor()->getMock(); $uri->expects($this->once())->method('withQuery')->with($this->equalTo(\GuzzleHttp\Psr7\build_query($fixtureQuery)))->willReturn($uri); $orgRequest->expects($this->once())->method('getMethod'); $orgRequest->expects($this->once())->method('getUri')->willReturn($uri); $guzzleRequest = new GuzzleTransportRequest($orgRequest); $guzzleRequest->setQueryParams($fixtureQuery); }