Skip to content
Prev Previous commit
Next Next commit
Added tests for escaped body
  • Loading branch information
Nyholm committed Aug 1, 2016
commit 105d882fdf4b6f25839cb65b099dffe38456a4ea
4 changes: 2 additions & 2 deletions spec/Formatter/CurlCommandFormatterSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,15 @@ function it_formats_post_request(RequestInterface $request, UriInterface $uri, S
$request->getUri()->willReturn($uri);
$request->getBody()->willReturn($body);

$body->__toString()->willReturn('body data');
$body->__toString()->willReturn('body " data'." test' bar");

$uri->__toString()->willReturn('http://foo.com/bar');
$request->getMethod()->willReturn('POST');
$request->getProtocolVersion()->willReturn('2.0');

$request->getHeaders()->willReturn([]);

$this->formatRequest($request)->shouldReturn('curl \'http://foo.com/bar\' --http2 --request POST --data \'body data\'');
$this->formatRequest($request)->shouldReturn("curl 'http://foo.com/bar' --http2 --request POST --data 'body \" data test'\'' bar'");
}

function it_does_nothing_for_response(ResponseInterface $response)
Expand Down