aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar Stanley Cheung <stanleycheung@google.com>2015-08-28 16:11:00 -0700
committerGravatar Stanley Cheung <stanleycheung@google.com>2015-09-02 13:34:40 -0700
commit03e170eaf01b0790feffc582dd1e3d1c451715e4 (patch)
treef7e2a7c4b1f1ce3ecdad5db22f7170512306d970 /src
parent5331776c17f775911fedcadfcb530bd46af024ea (diff)
php: add cancel_after_begin interop test
Diffstat (limited to 'src')
-rwxr-xr-xsrc/php/tests/interop/interop_client.php21
1 files changed, 16 insertions, 5 deletions
diff --git a/src/php/tests/interop/interop_client.php b/src/php/tests/interop/interop_client.php
index 28782735c0..d55d5629b7 100755
--- a/src/php/tests/interop/interop_client.php
+++ b/src/php/tests/interop/interop_client.php
@@ -251,6 +251,19 @@ function pingPong($stub) {
}
/**
+ * 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
* @param $stub Stub object that has service methods.
@@ -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);