@@ -60,6 +60,10 @@ public function testGetContentStringBody(): void
6060 'abc ' => 'def ' ,
6161 'REQUEST_METHOD ' => 'POST ' ,
6262 ],
63+ 'response-content-toarray ' => [
64+ 'abc ' => 'def ' ,
65+ 'REQUEST_METHOD ' => 'POST ' ,
66+ ],
6367 ],
6468 ];
6569 $ this ->assertSameResponseContentLog ($ expected , $ logger ->logs );
@@ -101,6 +105,10 @@ public function testGetContentIterableYieldBody(): void
101105 'abc ' => 'def ' ,
102106 'REQUEST_METHOD ' => 'POST ' ,
103107 ],
108+ 'response-content-toarray ' => [
109+ 'abc ' => 'def ' ,
110+ 'REQUEST_METHOD ' => 'POST ' ,
111+ ],
104112 ],
105113 ];
106114 $ this ->assertSameResponseContentLog ($ expected , $ logger ->logs );
@@ -134,10 +142,16 @@ public function testGetContentJsonBody(): void
134142 [
135143 'message ' => 'Response content: "200 http://127.0.0.1:8057/post" ' ,
136144 'request-content ' => '{"abc":"def"} ' ,
145+ 'request-content-json ' => ['abc ' => 'def ' ],
146+ 'request-content-toarray ' => ['abc ' => 'def ' ],
137147 'response-content-json ' => [
138148 '{"abc":"def"} ' => '' ,
139149 'REQUEST_METHOD ' => 'POST ' ,
140150 ],
151+ 'response-content-toarray ' => [
152+ '{"abc":"def"} ' => '' ,
153+ 'REQUEST_METHOD ' => 'POST ' ,
154+ ],
141155 ],
142156 ];
143157
@@ -176,6 +190,10 @@ public function testToArray(): void
176190 'abc ' => 'def ' ,
177191 'REQUEST_METHOD ' => 'POST ' ,
178192 ],
193+ 'response-content-toarray ' => [
194+ 'abc ' => 'def ' ,
195+ 'REQUEST_METHOD ' => 'POST ' ,
196+ ],
179197 ],
180198 ];
181199 $ this ->assertSameResponseContentLog ($ expected , $ logger ->logs );
@@ -225,6 +243,10 @@ public function testStream(): void
225243 'abc ' => 'def ' ,
226244 'REQUEST_METHOD ' => 'POST ' ,
227245 ],
246+ 'response-content-toarray ' => [
247+ 'abc ' => 'def ' ,
248+ 'REQUEST_METHOD ' => 'POST ' ,
249+ ],
228250 ],
229251 ];
230252 $ this ->assertSameResponseContentLog ($ expected , $ logger ->logs );
@@ -267,6 +289,10 @@ public function testToStream(): void
267289 'abc ' => 'def ' ,
268290 'REQUEST_METHOD ' => 'POST ' ,
269291 ],
292+ 'response-content-toarray ' => [
293+ 'abc ' => 'def ' ,
294+ 'REQUEST_METHOD ' => 'POST ' ,
295+ ],
270296 ],
271297 ];
272298 $ this ->assertSameResponseContentLog ($ expected , $ logger ->logs );
@@ -302,6 +328,10 @@ public function testDestroyResponse(): void
302328 'abc ' => 'def ' ,
303329 'REQUEST_METHOD ' => 'POST ' ,
304330 ],
331+ 'response-content-toarray ' => [
332+ 'abc ' => 'def ' ,
333+ 'REQUEST_METHOD ' => 'POST ' ,
334+ ],
305335 ],
306336 ];
307337 $ this ->assertSameResponseContentLog ($ expected , $ logger ->logs );
@@ -400,6 +430,10 @@ public function testCancelResponseAfterGetContent(): void
400430 'abc ' => 'def ' ,
401431 'REQUEST_METHOD ' => 'POST ' ,
402432 ],
433+ 'response-content-toarray ' => [
434+ 'abc ' => 'def ' ,
435+ 'REQUEST_METHOD ' => 'POST ' ,
436+ ],
403437 'response-headers-content-type ' => ['application/json ' ],
404438 'info-canceled ' => false ,
405439 ],
@@ -491,6 +525,18 @@ public function testHttp404(): void
491525 'HTTP_ACCEPT_ENCODING ' => 'gzip ' ,
492526 'HTTP_HOST ' => '127.0.0.1:8057 ' ,
493527 ],
528+ 'response-content-toarray ' => [
529+ 'SERVER_PROTOCOL ' => 'HTTP/1.1 ' ,
530+ 'SERVER_NAME ' => '127.0.0.1 ' ,
531+ 'REQUEST_URI ' => '/404 ' ,
532+ 'REQUEST_METHOD ' => 'POST ' ,
533+ 'HTTP_ACCEPT ' => '*/* ' ,
534+ 'HTTP_CONTENT_LENGTH ' => '7 ' ,
535+ 'HTTP_CONTENT_TYPE ' => 'application/x-www-form-urlencoded ' ,
536+ 'HTTP_USER_AGENT ' => 'Symfony HttpClient (Amp) ' ,
537+ 'HTTP_ACCEPT_ENCODING ' => 'gzip ' ,
538+ 'HTTP_HOST ' => '127.0.0.1:8057 ' ,
539+ ],
494540 ],
495541 ];
496542 $ this ->assertSameResponseContentLog ($ expected , $ logger ->logs );
@@ -541,6 +587,18 @@ public function testHttp404ThrowHttpException(): void
541587 'HTTP_ACCEPT_ENCODING ' => 'gzip ' ,
542588 'HTTP_HOST ' => '127.0.0.1:8057 ' ,
543589 ],
590+ 'response-content-toarray ' => [
591+ 'SERVER_PROTOCOL ' => 'HTTP/1.1 ' ,
592+ 'SERVER_NAME ' => '127.0.0.1 ' ,
593+ 'REQUEST_URI ' => '/404 ' ,
594+ 'REQUEST_METHOD ' => 'POST ' ,
595+ 'HTTP_ACCEPT ' => '*/* ' ,
596+ 'HTTP_CONTENT_LENGTH ' => '7 ' ,
597+ 'HTTP_CONTENT_TYPE ' => 'application/x-www-form-urlencoded ' ,
598+ 'HTTP_USER_AGENT ' => 'Symfony HttpClient (Amp) ' ,
599+ 'HTTP_ACCEPT_ENCODING ' => 'gzip ' ,
600+ 'HTTP_HOST ' => '127.0.0.1:8057 ' ,
601+ ],
544602 ],
545603 ];
546604 $ this ->assertSameResponseContentLog ($ expected , $ logger ->logs );
0 commit comments