php: add cancel_after_begin interop test

pull/3181/head
Stanley Cheung 10 years ago
parent 5331776c17
commit 03e170eaf0
  1. 21
      src/php/tests/interop/interop_client.php

@ -250,6 +250,19 @@ function pingPong($stub) {
'Call did not complete successfully');
}
/**
* Run the cancel_after_begin test.
* Passes when run against the Node server as of 2015-08-28
* @param $stub Stub object that has service methods.
*/
function cancelAfterBegin($stub) {
$call = $stub->StreamingInputCall();
$call->cancel();
list($result, $status) = $call->wait();
hardAssert($status->code === Grpc\STATUS_CANCELLED,
'Call status was not CANCELLED');
}
/**
* Run the cancel_after_first_response test.
* Passes when run against the Node server as of 2015-04-30
@ -357,6 +370,9 @@ switch ($args['test_case']) {
case 'ping_pong':
pingPong($stub);
break;
case 'cancel_after_begin':
cancelAfterBegin($stub);
break;
case 'cancel_after_first_response':
cancelAfterFirstResponse($stub);
break;
@ -372,11 +388,6 @@ switch ($args['test_case']) {
case 'jwt_token_creds':
jwtTokenCreds($stub, $args);
break;
case 'cancel_after_begin':
// Currently unimplementable with the current API design
// Specifically, in the ClientStreamingCall->start() method, the
// messages are sent immediately after metadata is sent. There is
// currently no way to cancel before messages are sent.
default:
echo "Unsupported test case $args[test_case]\n";
exit(1);

Loading…
Cancel
Save