diff options
author | 2016-02-16 11:43:35 -0800 | |
---|---|---|
committer | 2016-02-16 11:43:35 -0800 | |
commit | 221bb1dae0feb7801dacd4f2c32045a2e15651d9 (patch) | |
tree | 6cf0281717b129a91ad385f44e7359ef952f0aec /src/php/tests/unit_tests/CallTest.php | |
parent | e683814416a724d1e110180ddf13848a028f1a34 (diff) | |
parent | f77a4ad9f7d0e84ee418165c4c9a604ea89780f9 (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-x | src/php/tests/unit_tests/CallTest.php | 28 |
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); + } + } |