@@ -303,6 +303,56 @@ public function testBidiOpeningRequestLogsRpcName()
303303 $ this ->assertNotEmpty ($ unserializedBuffer );
304304 $ this ->assertNotEmpty ($ unserializedBuffer ['rpcName ' ]);
305305 $ this ->assertEquals ($ rpcName , $ unserializedBuffer ['rpcName ' ]);
306+ $ this ->assertNotEmpty ($ unserializedBuffer ['jsonPayload ' ]);
307+ $ this ->assertEquals ('grpc:// ' , $ unserializedBuffer ['jsonPayload ' ]['request.url ' ]);
308+ }
309+
310+ public function testServerStreamingRequestLogsUrl ()
311+ {
312+ $ rpcName = 'takeAction ' ;
313+ $ serverStreamingCall = $ this ->prophesize (\Grpc \ServerStreamingCall::class);
314+ $ message = $ this ->createMockRequest ();
315+
316+ $ transport = new MockGrpcTransport (
317+ $ serverStreamingCall ->reveal (),
318+ logger: new StdOutLogger ()
319+ );
320+
321+ $ stream = $ transport ->startServerStreamingCall (
322+ new Call ($ rpcName , null , $ message ),
323+ ['headers ' => []]
324+ );
325+
326+ $ buffer = $ this ->getActualOutput ();
327+ $ unserializedBuffer = json_decode ($ buffer , true );
328+
329+ $ this ->assertNotEmpty ($ unserializedBuffer );
330+ $ this ->assertNotEmpty ($ unserializedBuffer ['jsonPayload ' ]);
331+ $ this ->assertEquals ('grpc:// ' , $ unserializedBuffer ['jsonPayload ' ]['request.url ' ]);
332+ }
333+
334+ public function testUnaryRequestLogsUrl ()
335+ {
336+ $ rpcName = 'takeAction ' ;
337+ $ unaryCall = $ this ->prophesize (\Grpc \UnaryCall::class);
338+ $ message = $ this ->createMockRequest ();
339+
340+ $ transport = new MockGrpcTransport (
341+ $ unaryCall ->reveal (),
342+ logger: new StdOutLogger ()
343+ );
344+
345+ $ transport ->startUnaryCall (
346+ new Call ($ rpcName , null , $ message ),
347+ ['headers ' => []]
348+ );
349+
350+ $ buffer = $ this ->getActualOutput ();
351+ $ unserializedBuffer = json_decode ($ buffer , true );
352+
353+ $ this ->assertNotEmpty ($ unserializedBuffer );
354+ $ this ->assertNotEmpty ($ unserializedBuffer ['jsonPayload ' ]);
355+ $ this ->assertEquals ('grpc:// ' , $ unserializedBuffer ['jsonPayload ' ]['request.url ' ]);
306356 }
307357
308358 public function testBidiStreamingSuccessObject ()
0 commit comments