php: implement empty_stream interop test

pull/3758/head
Stanley Cheung 9 years ago
parent 4d3fc1452f
commit e5ba29f337
  1. 19
      src/php/tests/interop/interop_client.php

@ -250,6 +250,22 @@ function pingPong($stub) {
'Call did not complete successfully');
}
/**
* Run the empty_stream test.
* Passes when run against the Node server as of 2015-10-09
* @param $stub Stub object that has service methods.
*/
function emptyStream($stub) {
// for the current PHP implementation, $call->read() will wait
// forever for a server response if the server is not sending any.
// so this test is imeplemented as a timeout to indicate the absence
// of receiving any response from the server
$call = $stub->FullDuplexCall(array('timeout' => 100000));
hardAssert($call->read() === null, 'Server returned too many responses');
hardAssert($call->getStatus()->code === Grpc\STATUS_DEADLINE_EXCEEDED,
'Call did not complete successfully');
}
/**
* Run the cancel_after_begin test.
* Passes when run against the Node server as of 2015-08-28
@ -370,6 +386,9 @@ switch ($args['test_case']) {
case 'ping_pong':
pingPong($stub);
break;
case 'empty_stream':
emptyStream($stub);
break;
case 'cancel_after_begin':
cancelAfterBegin($stub);
break;

Loading…
Cancel
Save