diff options
author | murgatroid99 <michael.lumish@gmail.com> | 2015-02-02 11:05:01 -0800 |
---|---|---|
committer | murgatroid99 <michael.lumish@gmail.com> | 2015-02-02 11:05:01 -0800 |
commit | 25e5f67bb95f4c848c003f19272b8c1030efbfe5 (patch) | |
tree | e4886de5f2d554edfe63653c9d31f3decbed1ecc /src/php/tests | |
parent | 26b18f09b966a110b5cba5eca325928c868298f0 (diff) |
Removed all instances of == and != in PHP code
Diffstat (limited to 'src/php/tests')
-rwxr-xr-x | src/php/tests/interop/interop_client.php | 34 |
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'); } |