convertRequestToCurlCommand() public static méthode

Converts Request to Curl console command.
public static convertRequestToCurlCommand ( Request $request ) : string
$request Request
Résultat string
 public function testConvertRequestToCurlCommand()
 {
     $path = 'test';
     $method = Request::POST;
     $query = array('no' => 'params');
     $data = array('key' => 'value');
     $connection = new Connection();
     $connection->setHost('localhost');
     $connection->setPort('9200');
     $request = new Request($path, $method, $data, $query, $connection);
     $curlCommand = Util::convertRequestToCurlCommand($request);
     $expected = 'curl -XPOST \'http://localhost:9200/test?no=params\' -d \'{"key":"value"}\'';
     $this->assertEquals($expected, $curlCommand);
 }