@@ -248,7 +248,7 @@ public static function provideCurlRequests(): iterable
248248 --header %1$sContent-Type: application/x-www-form-urlencoded%1$s \\
249249 --header %1$sAccept-Encoding: gzip%1$s \\
250250 --header %1$sUser-Agent: Symfony HttpClient (Native)%1$s \\
251- --data %1$sfoobarbaz%1$s ' ,
251+ --data-raw %1$sfoobarbaz%1$s ' ,
252252 ];
253253 yield 'POST with array body ' => [
254254 [
@@ -286,7 +286,7 @@ public function __toString(): string
286286 --header %1$sContent-Length: 211%1$s \\
287287 --header %1$sAccept-Encoding: gzip%1$s \\
288288 --header %1$sUser-Agent: Symfony HttpClient (Native)%1$s \\
289- --data %1$sfoo=fooval%1$s --data %1$sbar=barval%1$s --data %1$sbaz=bazval%1$s --data %1$sfoobar[baz]=bazval%1$s --data %1$sfoobar[qux]=quxval%1$s --data %1$sbazqux[0]=bazquxval1%1$s --data %1$sbazqux[1]=bazquxval2%1$s --data %1$sobject[fooprop]=foopropval%1$s --data %1$sobject[barprop]=barpropval%1$s --data %1$stostring=tostringval%1$s ' ,
289+ --data-raw %1$sfoo=fooval%1$s --data-raw %1$sbar=barval%1$s --data-raw %1$sbaz=bazval%1$s --data-raw %1$sfoobar[baz]=bazval%1$s --data-raw %1$sfoobar[qux]=quxval%1$s --data-raw %1$sbazqux[0]=bazquxval1%1$s --data-raw %1$sbazqux[1]=bazquxval2%1$s --data-raw %1$sobject[fooprop]=foopropval%1$s --data-raw %1$sobject[barprop]=barpropval%1$s --data-raw %1$stostring=tostringval%1$s ' ,
290290 ];
291291
292292 // escapeshellarg on Windows replaces double quotes & percent signs with spaces
@@ -337,7 +337,7 @@ public function __toString(): string
337337 --header %1$sContent-Length: 120%1$s \\
338338 --header %1$sAccept-Encoding: gzip%1$s \\
339339 --header %1$sUser-Agent: Symfony HttpClient (Native)%1$s \\
340- --data %1$s{"foo":{"bar":"baz","qux":[1.1,1.0],"fred":["\u003Cfoo\u003E","\u0027bar\u0027","\u0022baz\u0022","\u0026blong\u0026"]}}%1$s ' ,
340+ --data-raw %1$s{"foo":{"bar":"baz","qux":[1.1,1.0],"fred":["\u003Cfoo\u003E","\u0027bar\u0027","\u0022baz\u0022","\u0026blong\u0026"]}}%1$s ' ,
341341 ];
342342 }
343343 }
@@ -397,29 +397,7 @@ public function testItDoesNotGeneratesCurlCommandsForUnsupportedBodyType()
397397 /**
398398 * @requires extension openssl
399399 */
400- public function testItDoesNotGeneratesCurlCommandsForNotEncodableBody ()
401- {
402- $ sut = new HttpClientDataCollector ();
403- $ sut ->registerClient ('http_client ' , $ this ->httpClientThatHasTracedRequests ([
404- [
405- 'method ' => 'POST ' ,
406- 'url ' => 'http://localhost:8057/json ' ,
407- 'options ' => [
408- 'body ' => "\0" ,
409- ],
410- ],
411- ]));
412- $ sut ->lateCollect ();
413- $ collectedData = $ sut ->getClients ();
414- self ::assertCount (1 , $ collectedData ['http_client ' ]['traces ' ]);
415- $ curlCommand = $ collectedData ['http_client ' ]['traces ' ][0 ]['curlCommand ' ];
416- self ::assertNull ($ curlCommand );
417- }
418-
419- /**
420- * @requires extension openssl
421- */
422- public function testItDoesNotGeneratesCurlCommandsForTooBigData ()
400+ public function testItDoesGenerateCurlCommandsForBigData ()
423401 {
424402 $ sut = new HttpClientDataCollector ();
425403 $ sut ->registerClient ('http_client ' , $ this ->httpClientThatHasTracedRequests ([
@@ -435,7 +413,7 @@ public function testItDoesNotGeneratesCurlCommandsForTooBigData()
435413 $ collectedData = $ sut ->getClients ();
436414 self ::assertCount (1 , $ collectedData ['http_client ' ]['traces ' ]);
437415 $ curlCommand = $ collectedData ['http_client ' ]['traces ' ][0 ]['curlCommand ' ];
438- self ::assertNull ($ curlCommand );
416+ self ::assertNotNull ($ curlCommand );
439417 }
440418
441419 private function httpClientThatHasTracedRequests ($ tracedRequests ): TraceableHttpClient
0 commit comments