Merge pull request #24234 from HannahShiSFB/special-status-msg-interop-test

PHP: add special status msg interop test
pull/24364/head
Stanley Cheung 4 years ago committed by GitHub
commit 5256cdf895
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 27
      src/php/tests/interop/interop_client.php
  2. 1
      tools/run_tests/run_interop_tests.py

@ -609,6 +609,31 @@ function statusCodeAndMessage($stub)
$status->details);
}
function specialStatusMessage($stub)
{
$test_code = Grpc\STATUS_UNKNOWN;
$test_msg = "\t\ntest with whitespace\r\nand Unicode BMP ☺ and non-BMP 😈\t\n";
$echo_status = new Grpc\Testing\EchoStatus();
$echo_status->setCode($test_code);
$echo_status->setMessage($test_msg);
$request = new Grpc\Testing\SimpleRequest();
$request->setResponseStatus($echo_status);
$call = $stub->UnaryCall($request);
list($result, $status) = $call->wait();
hardAssert(
$status->code === $test_code,
'Received unexpected UnaryCall status code: ' . $status->code
);
hardAssert(
$status->details === $test_msg,
'Received unexpected UnaryCall status details: ' . $status->details
);
}
# NOTE: the stub input to this function is from UnimplementedService
function unimplementedService($stub)
{
@ -761,6 +786,8 @@ function interop_main($args, $stub = false)
case 'status_code_and_message':
statusCodeAndMessage($stub);
break;
case 'special_status_message':
specialStatusMessage($stub);
case 'unimplemented_service':
unimplementedService($stub);
break;

@ -501,7 +501,6 @@ class PHP7Language:
def unimplemented_test_cases(self):
return _SKIP_SERVER_COMPRESSION + \
_SKIP_DATA_FRAME_PADDING + \
_SKIP_SPECIAL_STATUS_MESSAGE + \
_SKIP_GOOGLE_DEFAULT_CREDS + \
_SKIP_COMPUTE_ENGINE_CHANNEL_CREDS

Loading…
Cancel
Save