Copied!

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)

  • internal
CloneableInstantiable
Methods
public __construct(array $responses, $deserialize = NULL, ?stdClass $status = NULL)
 

MockBidiStreamingCall constructor.

  • param mixed[] $responses A list of response objects.
  • param mixed|null $deserialize An optional deserialize method for the response object.
  • param \stdClass|null $status An optional status object. If set to null, a status of OK is used.
public Grpc\AbstractCall::cancel()
 

Cancels the call.

public Grpc\AbstractCall::getMetadata()
 
  • return mixed The metadata sent by the server
public Grpc\AbstractCall::getPeer()
 
  • return string The URI of the endpoint
public getStatus()
 
  • return \stdClass|null
  • throws \ApiException
public Grpc\AbstractCall::getTrailingMetadata()
 
  • return mixed The trailing metadata sent by the server
public popReceivedCalls()
 

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

  • return mixed[] An array of received requests
public read()
 
  • return mixed|null
  • throws \ApiException
public Grpc\AbstractCall::setCallCredentials( $call_credentials)
 

Set the CallCredentials for the underlying Call.

  • param \CallCredentials $call_credentials The CallCredentials object
public Grpc\BidiStreamingCall::start(array $metadata = [])
 

Start the call.

  • param array $metadata Metadata to send with the call, if applicable (optional)
public write( $request, array $options = [])
 

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

  • param \Message|mixed $request The request object
  • param array $options An array of options.
  • throws \ApiException
public writesDone()
 

Set writesDone to true

Properties
protected Grpc\AbstractCall::$call = NULL
 
  • var \Call
protected Grpc\AbstractCall::$deserialize = NULL
protected Grpc\AbstractCall::$metadata = NULL
protected Grpc\AbstractCall::$trailing_metadata = NULL
Methods
protected Grpc\AbstractCall::_deserializeResponse( $value)
 

Deserialize a response value to an object.

  • param string $value The binary value to deserialize
  • return mixed The deserialized value
protected Grpc\AbstractCall::_serializeMessage( $data)
 

Serialize a message to the protobuf binary format.

  • param mixed $data The Protobuf message
  • return string The protobuf binary format
protected deserializeMessage( $message, $deserialize)
 
  • param mixed $message
  • param mixed $deserialize
Properties
private $receivedWrites = []
private $responses = NULL
private $status = NULL
private $writesDone = false
© 2026 Bruce Wells
Search Namespaces \ Classes
Configuration