Skip to content

Commit 714059c

Browse files
OskarStarknicolas-grekas
authored andcommitted
Add check and tests for public properties
1 parent 43998e6 commit 714059c

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

Tests/MockHttpClientTest.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -400,4 +400,22 @@ public function testChangeResponseFactory()
400400

401401
$this->assertSame($expectedBody, $response->getContent());
402402
}
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+
}
403421
}

0 commit comments

Comments
 (0)