MockClientStreamingCall
class MockClientStreamingCall extends ClientStreamingCall (View source)
internal |
The MockClientStreamingCall class is used to mock out the \Grpc\ClientStreamingCall class (https://github.com/grpc/grpc/blob/master/src/php/lib/Grpc/ClientStreamingCall.php)
The MockClientStreamingCall object is constructed with a response object, an optional deserialize method, and an optional status. The response object and status are returned immediately from the wait() method. It also provides a write() method that accepts request objects, and a getAllRequests() method that returns all request objects passed to write(), and clears them.
Methods
MockClientStreamingCall constructor.
Immediately return the preset response object and status.
Save the request object, to be retrieved via getReceivedCalls()
Return a list of calls made to write(), and clear $receivedFuncCalls.
Details
__construct(Message|string $response, callable|array|null $deserialize = null, stdClass $status = null)
MockClientStreamingCall constructor.
array
wait()
Immediately return the preset response object and status.
write(Message|mixed $request, array $options = [])
Save the request object, to be retrieved via getReceivedCalls()
array
popReceivedCalls()
Return a list of calls made to write(), and clear $receivedFuncCalls.