Skip to content

Commit 5fab53b

Browse files
authored
Add toJson method to Jsonable and Fluent classes (#6761)
1 parent 76db4bf commit 5fab53b

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

tests/CoreMiddlewareTest.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,11 @@ public function __toString(): string
103103
{
104104
return json_encode(['foo' => 'bar'], JSON_UNESCAPED_UNICODE);
105105
}
106+
107+
public function toJson($options = 0): string
108+
{
109+
return json_encode(['foo' => 'bar'], $options);
110+
}
106111
}, $request);
107112
$this->assertInstanceOf(ResponseInterface::class, $response);
108113
$this->assertSame(json_encode(['foo' => 'bar']), (string) $response->getBody());

0 commit comments

Comments
 (0)