aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/php/tests/unit_tests/CallTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'src/php/tests/unit_tests/CallTest.php')
-rwxr-xr-xsrc/php/tests/unit_tests/CallTest.php19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/php/tests/unit_tests/CallTest.php b/src/php/tests/unit_tests/CallTest.php
index 150b8c3860..253052a038 100755
--- a/src/php/tests/unit_tests/CallTest.php
+++ b/src/php/tests/unit_tests/CallTest.php
@@ -9,12 +9,31 @@ class CallTest extends PHPUnit_Framework_TestCase{
}
public function setUp() {
+ $this->cq = new Grpc\CompletionQueue();
$this->channel = new Grpc\Channel('localhost:9001', []);
$this->call = new Grpc\Call($this->channel,
'/foo',
Grpc\Timeval::inf_future());
}
+ /**
+ * @expectedException LogicException
+ * @expectedExceptionCode Grpc\CALL_ERROR_INVALID_FLAGS
+ * @expectedExceptionMessage start_invoke
+ */
+ public function testStartInvokeRejectsBadFlags() {
+ $this->call->start_invoke($this->cq, 0, 0, 0, 0xDEADBEEF);
+ }
+
+ /**
+ * @expectedException LogicException
+ * @expectedExceptionCode Grpc\CALL_ERROR_NOT_ON_CLIENT
+ * @expectedExceptionMessage server_accept
+ */
+ public function testServerAcceptFailsCorrectly() {
+ $this->call->server_accept($this->cq, 0);
+ }
+
/* These test methods with assertTrue(true) at the end just check that the
method calls completed without errors. PHPUnit warns for tests with no
asserts, and this avoids that warning without changing the meaning of the