aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/php/tests/interop/interop_client.php
diff options
context:
space:
mode:
Diffstat (limited to 'src/php/tests/interop/interop_client.php')
-rwxr-xr-xsrc/php/tests/interop/interop_client.php34
1 files changed, 17 insertions, 17 deletions
diff --git a/src/php/tests/interop/interop_client.php b/src/php/tests/interop/interop_client.php
index 2ff2be7bca..d1f994a84b 100755
--- a/src/php/tests/interop/interop_client.php
+++ b/src/php/tests/interop/interop_client.php
@@ -26,8 +26,8 @@ function hardAssert($value, $error_message) {
*/
function emptyUnary($stub) {
list($result, $status) = $stub->EmptyCall(new grpc\testing\EmptyMessage())->wait();
- hardAssert($status->code == Grpc\STATUS_OK, 'Call did not complete successfully');
- hardAssert($result != null, 'Call completed with a null response');
+ hardAssert($status->code === Grpc\STATUS_OK, 'Call did not complete successfully');
+ hardAssert($result !== null, 'Call completed with a null response');
}
/**
@@ -49,14 +49,14 @@ function largeUnary($stub) {
$request->setPayload($payload);
list($result, $status) = $stub->UnaryCall($request)->wait();
- hardAssert($status->code == Grpc\STATUS_OK, 'Call did not complete successfully');
- hardAssert($result != null, 'Call returned a null response');
+ hardAssert($status->code === Grpc\STATUS_OK, 'Call did not complete successfully');
+ hardAssert($result !== null, 'Call returned a null response');
$payload = $result->getPayload();
- hardAssert($payload->getType() == grpc\testing\PayloadType::COMPRESSABLE,
+ hardAssert($payload->getType() === grpc\testing\PayloadType::COMPRESSABLE,
'Payload had the wrong type');
- hardAssert(strlen($payload->getBody()) == $response_len,
+ hardAssert(strlen($payload->getBody()) === $response_len,
'Payload had the wrong length');
- hardAssert($payload->getBody() == str_repeat("\0", $response_len),
+ hardAssert($payload->getBody() === str_repeat("\0", $response_len),
'Payload had the wrong content');
}
@@ -78,8 +78,8 @@ function clientStreaming($stub) {
}, $request_lengths);
list($result, $status) = $stub->StreamingInputCall($requests)->wait();
- hardAssert($status->code == Grpc\STATUS_OK, 'Call did not complete successfully');
- hardAssert($result->getAggregatedPayloadSize() == 74922,
+ hardAssert($status->code === Grpc\STATUS_OK, 'Call did not complete successfully');
+ hardAssert($result->getAggregatedPayloadSize() === 74922,
'aggregated_payload_size was incorrect');
}
@@ -100,15 +100,15 @@ function serverStreaming($stub) {
}
$call = $stub->StreamingOutputCall($request);
- hardAssert($call->getStatus()->code == Grpc\STATUS_OK,
+ hardAssert($call->getStatus()->code === Grpc\STATUS_OK,
'Call did not complete successfully');
$i = 0;
foreach($call->responses() as $value) {
hardAssert($i < 4, 'Too many responses');
$payload = $value->getPayload();
- hardAssert($payload->getType() == grpc\testing\PayloadType::COMPRESSABLE,
+ hardAssert($payload->getType() === grpc\testing\PayloadType::COMPRESSABLE,
'Payload ' . $i . ' had the wrong type');
- hardAssert(strlen($payload->getBody()) == $sizes[$i],
+ hardAssert(strlen($payload->getBody()) === $sizes[$i],
'Response ' . $i . ' had the wrong length');
}
}
@@ -136,16 +136,16 @@ function pingPong($stub) {
$call->write($request);
$response = $call->read();
- hardAssert($response != null, 'Server returned too few responses');
+ hardAssert($response !== null, 'Server returned too few responses');
$payload = $response->getPayload();
- hardAssert($payload->getType() == grpc\testing\PayloadType::COMPRESSABLE,
+ hardAssert($payload->getType() === grpc\testing\PayloadType::COMPRESSABLE,
'Payload ' . $i . ' had the wrong type');
- hardAssert(strlen($payload->getBody()) == $response_lengths[$i],
+ hardAssert(strlen($payload->getBody()) === $response_lengths[$i],
'Payload ' . $i . ' had the wrong length');
}
$call->writesDone();
- hardAssert($call->read() == null, 'Server returned too many responses');
- hardAssert($call->getStatus()->code == Grpc\STATUS_OK,
+ hardAssert($call->read() === null, 'Server returned too many responses');
+ hardAssert($call->getStatus()->code === Grpc\STATUS_OK,
'Call did not complete successfully');
}