diff options
author | murgatroid99 <michael.lumish@gmail.com> | 2015-02-03 18:16:23 -0800 |
---|---|---|
committer | murgatroid99 <michael.lumish@gmail.com> | 2015-02-03 18:16:23 -0800 |
commit | 75c9d2f5291f998c9263aebb26f8d87667290a4f (patch) | |
tree | e3b79625138e6d54d951059628f721715737f843 /src/php/tests/interop/interop_client.php | |
parent | 8c0596edcaf00680eea55455471cba84ccf8061e (diff) |
Added cancel_after_first_response interop test
Diffstat (limited to 'src/php/tests/interop/interop_client.php')
-rwxr-xr-x | src/php/tests/interop/interop_client.php | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/php/tests/interop/interop_client.php b/src/php/tests/interop/interop_client.php index d1f994a84b..afae738c7e 100755 --- a/src/php/tests/interop/interop_client.php +++ b/src/php/tests/interop/interop_client.php @@ -149,6 +149,25 @@ function pingPong($stub) { 'Call did not complete successfully'); } +function cancelAfterFirstResponse($stub) { + $call = $stub->StreamingInputCall(); + $request = new grpc\testing\StreamingOutputCallRequest(); + $request->setResponseType(grpc\testing\PayloadType::COMPRESSABLE); + $response_parameters = new grpc\testing\ResponseParameters(); + $response_parameters->setSize(31415); + $request->addResponseParameters($response_parameters); + $payload = new grpc\testing\Payload(); + $payload->setBody(str_repeat("\0", 27182)); + $request->setPayload($payload); + + $call->write($request); + $response = $call->read(); + + $call->cancel(); + hardAssert($call->getStatus()->code === Grpc\STATUS_CANCELLED, + 'Call status was not CANCELLED'); +} + $args = getopt('', array('server_host:', 'server_port:', 'test_case:')); if (!array_key_exists('server_host', $args) || !array_key_exists('server_port', $args) || @@ -187,4 +206,6 @@ switch($args['test_case']) { case 'ping_pong': pingPong($stub); break; + case 'cancel_after_first_response': + cancelAfterFirstResponse($stub); }
\ No newline at end of file |