Copied!
  • internal
CloneableInstantiable
Methods
public __call(string $name, array $arguments)
public __construct(?callable $deserialize = NULL)
public _bidiRequest( $method, $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.

  • param string $method The name of the method to call
  • param callable $deserialize A function that deserializes the responses
  • param array $metadata A metadata map to send to the server (optional)
  • param array $options An array of options (optional)
  • return \MockBidiStreamingCall The active call object
public _clientStreamRequest( $method, $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

  • param string $method The name of the method to call
  • param callable $deserialize A function that deserializes the responses
  • param array $metadata A metadata map to send to the server (optional)
  • param array $options An array of options (optional)
  • return \MockClientStreamingCall The active call object
public _serverStreamRequest( $method, $argument, $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.

  • param string $method The name of the method to call
  • param \Google\Protobuf\Internal\Message $argument The argument to the method
  • param callable $deserialize A function that deserializes the responses
  • param array $metadata A metadata map to send to the server (optional)
  • param array $options An array of options (optional)
  • return \MockServerStreamingCall The active call object
public _simpleRequest( $method, $argument, $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

  • param string $method The API method name to be called
  • param \Google\Protobuf\Internal\Message $argument The request object to the API method
  • param callable $deserialize A function to deserialize the response object
  • param array $metadata
  • param array $options
  • return \MockUnaryCall
public addResponse( $response, ?stdClass $status = NULL)
 

Add a response object, and an optional status, to the list of responses to be returned via _simpleRequest.

  • param \Google\Protobuf\Internal\Message $response
  • param \stdClass $status
public close()
public static create( $responseObject, ?stdClass $status = NULL, ?callable $deserialize = NULL)
 
  • param mixed $responseObject
  • param \stdClass|null $status
  • param callable $deserialize
  • return static An instance of the current class type.
public static createWithResponseSequence(array $sequence, ?callable $deserialize = NULL, ?stdClass $finalStatus = NULL)
 

Creates a sequence such that the responses are returned in order.

  • param array $sequence
  • param callable $deserialize
  • param \stdClass $finalStatus
  • return static An instance of the current class type.
public getReceivedCallCount()
 
  • return int The number of calls received.
public isExhausted()
 
  • return bool True if $receivedFuncCalls and $response are empty.
public popCallObjects()
 
  • return array The call objects created by calls to the stub
public popReceivedCalls()
 

Return a list of calls made to _simpleRequest, and clear $receivedFuncCalls.

  • return \ReceivedRequest[] An array of received requests
public setAgentHeaderDescriptor( $agentHeaderDescriptor)
public setStreamingStatus(stdClass $status)
 

Set the status object to be used when creating streaming calls.

  • param \stdClass $status
public startBidiStreamingCall(Google\ApiCore\Call $call, array $options)
public startClientStreamingCall(Google\ApiCore\Call $call, array $options)
public startServerStreamingCall(Google\ApiCore\Call $call, array $options)
public startUnaryCall(Google\ApiCore\Call $call, array $options)
public static stripStatusFromResponses( $responses)
Properties
private $agentHeaderDescriptor = NULL
private $callObjects = []
private $deserialize = NULL
private $receivedFuncCalls = []
private $responses = []
private $serverStreamingStatus = NULL
Methods
public static create( $responseObject, ?stdClass $status = NULL, ?callable $deserialize = NULL)
 
  • param mixed $responseObject
  • param \stdClass|null $status
  • param callable $deserialize
  • return static An instance of the current class type.
public static createWithResponseSequence(array $sequence, ?callable $deserialize = NULL, ?stdClass $finalStatus = NULL)
 

Creates a sequence such that the responses are returned in order.

  • param array $sequence
  • param callable $deserialize
  • param \stdClass $finalStatus
  • return static An instance of the current class type.
public static stripStatusFromResponses( $responses)
© 2025 Bruce Wells
Search Namespaces \ Classes
Configuration