@@ -248,7 +248,7 @@ public static function provideCurlRequests(): iterable
248
248
--header %1$sContent-Type: application/x-www-form-urlencoded%1$s \\
249
249
--header %1$sAccept-Encoding: gzip%1$s \\
250
250
--header %1$sUser-Agent: Symfony HttpClient (Native)%1$s \\
251
- --data %1$sfoobarbaz%1$s ' ,
251
+ --data-raw %1$sfoobarbaz%1$s ' ,
252
252
];
253
253
yield 'POST with array body ' => [
254
254
[
@@ -286,7 +286,7 @@ public function __toString(): string
286
286
--header %1$sContent-Length: 211%1$s \\
287
287
--header %1$sAccept-Encoding: gzip%1$s \\
288
288
--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 ' ,
290
290
];
291
291
292
292
// escapeshellarg on Windows replaces double quotes & percent signs with spaces
@@ -337,7 +337,7 @@ public function __toString(): string
337
337
--header %1$sContent-Length: 120%1$s \\
338
338
--header %1$sAccept-Encoding: gzip%1$s \\
339
339
--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 ' ,
341
341
];
342
342
}
343
343
}
@@ -397,29 +397,7 @@ public function testItDoesNotGeneratesCurlCommandsForUnsupportedBodyType()
397
397
/**
398
398
* @requires extension openssl
399
399
*/
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 ()
423
401
{
424
402
$ sut = new HttpClientDataCollector ();
425
403
$ sut ->registerClient ('http_client ' , $ this ->httpClientThatHasTracedRequests ([
@@ -435,7 +413,7 @@ public function testItDoesNotGeneratesCurlCommandsForTooBigData()
435
413
$ collectedData = $ sut ->getClients ();
436
414
self ::assertCount (1 , $ collectedData ['http_client ' ]['traces ' ]);
437
415
$ curlCommand = $ collectedData ['http_client ' ]['traces ' ][0 ]['curlCommand ' ];
438
- self ::assertNull ($ curlCommand );
416
+ self ::assertNotNull ($ curlCommand );
439
417
}
440
418
441
419
private function httpClientThatHasTracedRequests ($ tracedRequests ): TraceableHttpClient
0 commit comments