aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/php/tests/unit_tests/CallTest.php
diff options
context:
space:
mode:
authorGravatar Michael Lumish <mlumish@google.com>2016-02-16 11:43:35 -0800
committerGravatar Michael Lumish <mlumish@google.com>2016-02-16 11:43:35 -0800
commit221bb1dae0feb7801dacd4f2c32045a2e15651d9 (patch)
tree6cf0281717b129a91ad385f44e7359ef952f0aec /src/php/tests/unit_tests/CallTest.php
parente683814416a724d1e110180ddf13848a028f1a34 (diff)
parentf77a4ad9f7d0e84ee418165c4c9a604ea89780f9 (diff)
Merge pull request #5225 from stanley-cheung/php-ext-code-coverage
PHP: add unit test to increase PHP C extension code coverage
Diffstat (limited to 'src/php/tests/unit_tests/CallTest.php')
-rwxr-xr-xsrc/php/tests/unit_tests/CallTest.php28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/php/tests/unit_tests/CallTest.php b/src/php/tests/unit_tests/CallTest.php
index 3b697b50c3..1170a440fa 100755
--- a/src/php/tests/unit_tests/CallTest.php
+++ b/src/php/tests/unit_tests/CallTest.php
@@ -91,4 +91,32 @@ class CallTest extends PHPUnit_Framework_TestCase
{
$this->assertTrue(is_string($this->call->getPeer()));
}
+
+ public function testCancel()
+ {
+ $this->assertNull($this->call->cancel());
+ }
+
+ /**
+ * @expectedException InvalidArgumentException
+ */
+ public function testInvalidMetadataKey()
+ {
+ $batch = [
+ 'invalid' => ['key1' => 'value1'],
+ ];
+ $result = $this->call->startBatch($batch);
+ }
+
+ /**
+ * @expectedException InvalidArgumentException
+ */
+ public function testInvalidMetadataInnerValue()
+ {
+ $batch = [
+ Grpc\OP_SEND_INITIAL_METADATA => ['key1' => 'value1'],
+ ];
+ $result = $this->call->startBatch($batch);
+ }
+
}