diff options
author | Eric Gribkoff <ericgribkoff@google.com> | 2017-01-06 09:16:29 -0800 |
---|---|---|
committer | Eric Gribkoff <ericgribkoff@google.com> | 2017-01-06 09:16:29 -0800 |
commit | ced8702d1d184fe83bbdcdfc97868a9f94868986 (patch) | |
tree | 1310485e70816416b11e62df415436b5b744e53a /src/php/tests | |
parent | 13ac3031aaf630956da68d6debe246c62922224d (diff) |
Enable advanced Java interop tests.
Add response parameters to custom_metadata streaming request for Node and PHP
clients.
The Java server does not respond with separate initial and trailing
metadata when there is no response data - it is only emiting the
requested trailing metadata. Adding the response parameters to the test
(in accordance with the specification) avoids this, but I will open a
separate issue to investigate the Java behavior.
Diffstat (limited to 'src/php/tests')
-rwxr-xr-x | src/php/tests/interop/interop_client.php | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/php/tests/interop/interop_client.php b/src/php/tests/interop/interop_client.php index d201915d66..2acf5612c7 100755 --- a/src/php/tests/interop/interop_client.php +++ b/src/php/tests/interop/interop_client.php @@ -451,11 +451,22 @@ function customMetadata($stub) $streaming_request = new grpc\testing\StreamingOutputCallRequest(); $streaming_request->setPayload($payload); + $response_parameters = new grpc\testing\ResponseParameters(); + $response_parameters->setSize($response_len); + $streaming_request->getResponseParameters()[] = $response_parameters; $streaming_call->write($streaming_request); $streaming_call->writesDone(); + $result = $streaming_call->read(); hardAssertIfStatusOk($streaming_call->getStatus()); + $streaming_initial_metadata = $streaming_call->getMetadata(); + hardAssert(array_key_exists($ECHO_INITIAL_KEY, $streaming_initial_metadata), + 'Initial metadata does not contain expected key'); + hardAssert( + $streaming_initial_metadata[$ECHO_INITIAL_KEY][0] === $ECHO_INITIAL_VALUE, + 'Incorrect initial metadata value'); + $streaming_trailing_metadata = $streaming_call->getTrailingMetadata(); hardAssert(array_key_exists($ECHO_TRAILING_KEY, $streaming_trailing_metadata), |