We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 43998e6 commit 714059cCopy full SHA for 714059c
Tests/MockHttpClientTest.php
@@ -400,4 +400,22 @@ public function testChangeResponseFactory()
400
401
$this->assertSame($expectedBody, $response->getContent());
402
}
403
+
404
+ public function testStringableBodyParam()
405
+ {
406
+ $client = new MockHttpClient();
407
408
+ $param = new class() {
409
+ public function __toString()
410
411
+ return 'bar';
412
+ }
413
+ };
414
415
+ $response = $client->request('GET', 'https://example.com', [
416
+ 'body' => ['foo' => $param],
417
+ ]);
418
419
+ $this->assertSame('foo=bar', $response->getRequestOptions()['body']);
420
421
0 commit comments