MockTransport
class MockTransport implements TransportInterface
Traits
Methods
Overrides the _simpleRequest method in \Grpc\BaseStub (https://github.com/grpc/grpc/blob/master/src/php/lib/Grpc/BaseStub.php) Returns a MockUnaryCall object that will return the first item from $responses
Overrides the _clientStreamRequest method in \Grpc\BaseStub (https://github.com/grpc/grpc/blob/master/src/php/lib/Grpc/BaseStub.php) Returns a MockClientStreamingCall object that will return the first item from $responses
Overrides the _serverStreamRequest method in \Grpc\BaseStub (https://github.com/grpc/grpc/blob/master/src/php/lib/Grpc/BaseStub.php) Returns a MockServerStreamingCall object that will stream items from $responses, and return a final status of $serverStreamingStatus.
Overrides the _bidiRequest method in \Grpc\BaseStub (https://github.com/grpc/grpc/blob/master/src/php/lib/Grpc/BaseStub.php) Returns a MockBidiStreamingCall object that will stream items from $responses, and return a final status of $serverStreamingStatus.
Add a response object, and an optional status, to the list of responses to be returned via _simpleRequest.
Return a list of calls made to _simpleRequest, and clear $receivedFuncCalls.
No description
Creates a sequence such that the responses are returned in order.
No description
No description
Closes the connection, if one exists.
Details
in MockStubTrait at line 52
__construct($deserialize = null)
in MockStubTrait at line 68
MockUnaryCall
_simpleRequest(string $method, Message $argument, callable $deserialize, array $metadata = [], array $options = [])
Overrides the _simpleRequest method in \Grpc\BaseStub (https://github.com/grpc/grpc/blob/master/src/php/lib/Grpc/BaseStub.php) Returns a MockUnaryCall object that will return the first item from $responses
in MockStubTrait at line 98
MockClientStreamingCall
_clientStreamRequest(string $method, callable $deserialize, array $metadata = [], array $options = [])
Overrides the _clientStreamRequest method in \Grpc\BaseStub (https://github.com/grpc/grpc/blob/master/src/php/lib/Grpc/BaseStub.php) Returns a MockClientStreamingCall object that will return the first item from $responses
in MockStubTrait at line 129
MockServerStreamingCall
_serverStreamRequest(string $method, Message $argument, callable $deserialize, array $metadata = [], array $options = [])
Overrides the _serverStreamRequest method in \Grpc\BaseStub (https://github.com/grpc/grpc/blob/master/src/php/lib/Grpc/BaseStub.php) Returns a MockServerStreamingCall object that will stream items from $responses, and return a final status of $serverStreamingStatus.
in MockStubTrait at line 164
MockBidiStreamingCall
_bidiRequest(string $method, callable $deserialize, array $metadata = [], array $options = [])
Overrides the _bidiRequest method in \Grpc\BaseStub (https://github.com/grpc/grpc/blob/master/src/php/lib/Grpc/BaseStub.php) Returns a MockBidiStreamingCall object that will stream items from $responses, and return a final status of $serverStreamingStatus.
in MockStubTrait at line 179
static
stripStatusFromResponses($responses)
in MockStubTrait at line 195
addResponse(Message $response, Status $status = null)
Add a response object, and an optional status, to the list of responses to be returned via _simpleRequest.
in MockStubTrait at line 212
setStreamingStatus(Status $status)
Set the status object to be used when creating streaming calls.
in MockStubTrait at line 222
ReceivedRequest[]
popReceivedCalls()
Return a list of calls made to _simpleRequest, and clear $receivedFuncCalls.
in MockStubTrait at line 232
int
getReceivedCallCount()
in MockStubTrait at line 240
mixed[]
popCallObjects()
in MockStubTrait at line 250
bool
isExhausted()
in MockStubTrait at line 262
static MockStubTrait
create(mixed $responseObject, $status = null, callable $deserialize = null)
in MockStubTrait at line 276
static MockStubTrait
createWithResponseSequence(mixed[] $sequence, callable $deserialize = null, Status $finalStatus = null)
Creates a sequence such that the responses are returned in order.
at line 50
setAgentHeaderDescriptor($agentHeaderDescriptor)
at line 55
PromiseInterface
startUnaryCall(Call $call, array $options)
Returns a promise used to execute network requests.
at line 72
BidiStream
startBidiStreamingCall(Call $call, array $options)
Starts a bidi streaming call.
at line 79
ClientStream
startClientStreamingCall(Call $call, array $options)
Starts a client streaming call.
at line 86
ServerStream
startServerStreamingCall(Call $call, array $options)
Starts a server streaming call.
at line 93
__call($name, $arguments)
at line 107
close()
Closes the connection, if one exists.