class MockUnaryCall extends UnaryCall (View source)

internal  
 

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

The MockUnaryCall 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.

Traits

Methods

deserializeMessage(mixed $message, mixed $deserialize)

No description

__construct(Message|string|null $response = null, callable|array|null $deserialize = null, stdClass $status = null)

MockUnaryCall constructor.

array
wait()

Immediately return the preset response object and status.

Details

protected deserializeMessage(mixed $message, mixed $deserialize)

No description

Parameters

mixed $message
mixed $deserialize

__construct(Message|string|null $response = null, callable|array|null $deserialize = null, stdClass $status = null)

MockUnaryCall constructor.

Parameters

Message|string|null $response

The response object.

callable|array|null $deserialize

An optional deserialize method for the response object.

stdClass $status

An optional status object. If set to null, a status of OK is used.

array wait()

Immediately return the preset response object and status.

Return Value

array

The response object and status.