Skip to content

Commit ad617b9

Browse files
committed
fix test
1 parent 5502410 commit ad617b9

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

tests/Unit/RequestHandler/PingRequestHandlerTest.php

+6-2
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,17 @@ public function testHandle(): void
2929
/** @var MockObject|ServerRequestInterface $request */
3030
$request = $this->getMockByCalls(ServerRequestInterface::class);
3131

32+
$bodyLength = 0;
33+
3234
/** @var MockObject|StreamInterface $body */
3335
$body = $this->getMockByCalls(StreamInterface::class, [
34-
Call::create('write')->with(new ArgumentCallback(static function (string $body): void {
36+
Call::create('write')->with(new ArgumentCallback(static function (string $body) use (&$bodyLength): void {
3537
$data = json_decode($body, true, 512, JSON_THROW_ON_ERROR);
3638

3739
self::assertArrayHasKey('datetime', $data);
38-
})),
40+
41+
$bodyLength = \strlen($body);
42+
}))->willReturn($bodyLength),
3943
]);
4044

4145
/** @var MockObject|ResponseInterface $response */

0 commit comments

Comments
 (0)