public function format(RequestInterface $request, array $options = [])
{
$this->command = 'curl';
$this->currentLineLength = strlen($this->command);
$this->options = [];
$this->extractArguments($request, $options);
$this->addOptionsToCommand();
return $this->command;
}
public function testProperBodyReading() { $request = new Request('PUT', 'example.local', [], Stream::factory('foo=bar&hello=world')); $request->getBody()->getContents(); $curl = $this->curlFormatter->format($request); $this->assertContains("-d 'foo=bar&hello=world'", $curl); $this->assertContains("-X PUT", $curl); }