aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/php/lib
diff options
context:
space:
mode:
authorGravatar Stanley Cheung <stanleycheung@google.com>2015-10-20 16:27:55 -0700
committerGravatar Stanley Cheung <stanleycheung@google.com>2015-10-20 16:27:55 -0700
commit75457ff7e15263fd659049d7b09a382dde706aea (patch)
treea8662c7432aba0790c2684c7bc6d9d7419db0d23 /src/php/lib
parent63544f78083fa03bbbf7c2c212c9f5ba968425e2 (diff)
php: add more unit test for code coverage analysis
Diffstat (limited to 'src/php/lib')
-rwxr-xr-xsrc/php/lib/Grpc/BaseStub.php4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/php/lib/Grpc/BaseStub.php b/src/php/lib/Grpc/BaseStub.php
index d4fb3ba17e..5614314598 100755
--- a/src/php/lib/Grpc/BaseStub.php
+++ b/src/php/lib/Grpc/BaseStub.php
@@ -114,7 +114,9 @@ class BaseStub {
return true;
}
if ($new_state == \Grpc\CHANNEL_FATAL_FAILURE) {
+ // @codeCoverageIgnoreStart
throw new \Exception('Failed to connect to server');
+ // @codeCoverageIgnoreEnd
}
return false;
}
@@ -132,7 +134,7 @@ class BaseStub {
private function _get_jwt_aud_uri($method) {
$last_slash_idx = strrpos($method, '/');
if ($last_slash_idx === false) {
- return false;
+ throw new \InvalidArgumentException('service name must have a slash');
}
$service_name = substr($method, 0, $last_slash_idx);
return "https://" . $this->hostname . $service_name;