Skip to content

Commit b6aef7f

Browse files
committed
HHVM test fixes
1 parent 5bd8b7e commit b6aef7f

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

tests/Functional/ConnectionTest.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -60,46 +60,46 @@ public function testSetTimeout60()
6060
public function testNoReplyWait()
6161
{
6262
\r\js('while(true) {}', 2.0)->run($this->conn, array('noreply' => true));
63-
$t = time(true);
63+
$t = microtime(true);
6464
$this->conn->noreplyWait();
6565

66-
$this->assertGreaterThan(1.5, time(true) - $t);
66+
$this->assertGreaterThan(1.5, microtime(true) - $t);
6767
}
6868

6969
public function testNoReplyReconnect()
7070
{
7171
\r\js('while(true) {}', 2.0)->run($this->conn, array('noreply' => true));
72-
$t = time(true);
72+
$t = microtime(true);
7373
$this->conn->reconnect();
7474

75-
$this->assertGreaterThan(1.5, time(true) - $t);
75+
$this->assertGreaterThan(1.5, microtime(true) - $t);
7676
}
7777

7878
public function testNoReplyClose()
7979
{
8080
\r\js('while(true) {}', 2.0)->run($this->conn, array('noreply' => true));
81-
$t = time(true);
81+
$t = microtime(true);
8282
$this->conn->close();
8383

84-
$this->assertGreaterThan(1.5, time(true) - $t);
84+
$this->assertGreaterThan(1.5, microtime(true) - $t);
8585
}
8686

8787
public function testNoReplyCloseImmediately()
8888
{
8989
\r\js('while(true) {}', 2.0)->run($this->conn, array('noreply' => true));
90-
$t = time(true);
90+
$t = microtime(true);
9191
$this->conn->close(false);
9292

93-
$this->assertLessThan(0.5, time(true) - $t);
93+
$this->assertLessThan(0.5, microtime(true) - $t);
9494
}
9595

9696
public function testNoReplyReconnectImmediately()
9797
{
9898
\r\js('while(true) {}', 2.0)->run($this->conn, array('noreply' => true));
99-
$t = time(true);
99+
$t = microtime(true);
100100
$this->conn->reconnect(false);
101101

102-
$this->assertLessThan(0.5, time(true) - $t);
102+
$this->assertLessThan(0.5, microtime(true) - $t);
103103
}
104104

105105
public function testServer()

tests/Functional/ValueTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public function testPositive()
4848

4949
public function testFloatMax()
5050
{
51-
$this->assertEquals((float)PHP_INT_MAX, \r\expr(PHP_INT_MAX)->run($this->conn));
51+
$this->assertEquals((float)PHP_INT_MAX, \r\expr((float)PHP_INT_MAX)->run($this->conn));
5252
}
5353

5454
public function testString()

0 commit comments

Comments
 (0)