aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/php/tests/unit_tests/EndToEndTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'src/php/tests/unit_tests/EndToEndTest.php')
-rwxr-xr-xsrc/php/tests/unit_tests/EndToEndTest.php17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/php/tests/unit_tests/EndToEndTest.php b/src/php/tests/unit_tests/EndToEndTest.php
index df4cebc966..4c0cf91d51 100755
--- a/src/php/tests/unit_tests/EndToEndTest.php
+++ b/src/php/tests/unit_tests/EndToEndTest.php
@@ -175,7 +175,7 @@ class EndToEndTest extends PHPUnit_Framework_TestCase{
$this->assertTrue($idle_state == Grpc\CHANNEL_IDLE);
$now = Grpc\Timeval::now();
- $delta = new Grpc\Timeval(100000);
+ $delta = new Grpc\Timeval(3000000); // should finish well before
$deadline = $now->add($delta);
$this->assertTrue($this->channel->watchConnectivityState(
@@ -184,4 +184,19 @@ class EndToEndTest extends PHPUnit_Framework_TestCase{
$new_state = $this->channel->getConnectivityState();
$this->assertTrue($idle_state != $new_state);
}
+
+ public function testWatchConnectivityStateDoNothing() {
+ $idle_state = $this->channel->getConnectivityState();
+ $this->assertTrue($idle_state == Grpc\CHANNEL_IDLE);
+
+ $now = Grpc\Timeval::now();
+ $delta = new Grpc\Timeval(100000);
+ $deadline = $now->add($delta);
+
+ $this->assertFalse($this->channel->watchConnectivityState(
+ $idle_state, $deadline));
+
+ $new_state = $this->channel->getConnectivityState();
+ $this->assertTrue($new_state == Grpc\CHANNEL_IDLE);
+ }
}