class MockBidiStreamingCall extends BidiStreamingCall (View source)

The MockBidiStreamingCall class is used to mock out the \Grpc\BidiStreamingCall class (https://github.com/grpc/grpc/blob/master/src/php/lib/Grpc/BidiStreamingCall.php)

Traits

Methods

deserializeMessage($message, $deserialize)

No description

__construct(array $responses, callable|null $deserialize = null, MockStatus|null $status = null)

MockBidiStreamingCall constructor.

mixed|null
read()

No description

MockStatus|null|stdClass
getStatus()

No description

write(Message|mixed $request, array $options = [])

Save the request object, to be retrieved via getReceivedCalls()

writesDone()

Set writesDone to true

array
popReceivedCalls()

Return a list of calls made to write(), and clear $receivedFuncCalls.

Details

protected deserializeMessage($message, $deserialize)

Parameters

$message
$deserialize

__construct(array $responses, callable|null $deserialize = null, MockStatus|null $status = null)

MockBidiStreamingCall constructor.

Parameters

array $responses A list of response objects.
callable|null $deserialize An optional deserialize method for the response object.
MockStatus|null $status An optional status object. If set to null, a status of OK is used.

mixed|null read()

Return Value

mixed|null

Exceptions

ApiException

MockStatus|null|stdClass getStatus()

Return Value

MockStatus|null|stdClass

Exceptions

ApiException

write(Message|mixed $request, array $options = [])

Save the request object, to be retrieved via getReceivedCalls()

Parameters

Message|mixed $request The request object
array $options An array of options.

Exceptions

ApiException

writesDone()

Set writesDone to true

array popReceivedCalls()

Return a list of calls made to write(), and clear $receivedFuncCalls.

Return Value

array An array of received requests