Skip to content

Commit e04ae59

Browse files
committed
Updated tests for 2.1. Also fixed use of use_outdated.
Fixes #99.
1 parent 8f02b9c commit e04ae59

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

src/rdb/queries/tables.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,9 @@ public function __construct($database, $tableName, $useOutdatedOrOpts = null) {
137137
$this->setPositionalArg($i++, $tableName);
138138
if (isset($useOutdatedOrOpts)) {
139139
if (is_bool($useOutdatedOrOpts)) {
140-
$this->setOptionalArg('use_outdated', new BoolDatum($useOutdatedOrOpts));
140+
if ($useOutdatedOrOpts) {
141+
$this->setOptionalArg('read_mode', new StringDatum("outdated"));
142+
}
141143
} else {
142144
foreach ($useOutdatedOrOpts as $opt => $val) {
143145
$this->setOptionalArg($opt, nativeToDatum($val));

tests/TestCases/DbTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ class DbTest extends TestCase
55
public function run()
66
{
77
$this->checkQueryResult(r\dbCreate('dbTest')->pluck('dbs_created'), array('dbs_created' => 1.0));
8-
$this->checkQueryResult(r\db('dbTest')->wait(), array('ready' => 0.0, 'status_changes' => array()));
8+
$this->checkQueryResult(r\db('dbTest')->wait(), array('ready' => 0.0));
99
$this->checkQueryResult(r\db('dbTest')->rebalance(), array());
1010
$this->checkQueryResult(r\db('dbTest')->reconfigure(array('shards' => 1, 'replicas' => 1)), array());
1111
$this->checkQueryResult(r\dbDrop('dbTest')->pluck('dbs_dropped'), array('dbs_dropped' => 1.0));

tests/TestCases/GeoTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ public function run()
2121

2222
// These might fail due to rounding issues, depending on the server's architecture
2323
$this->checkQueryResult(r\point(0.0, 1.0)->distance(r\point(1.0, 1.0))->coerceTo("STRING"),
24-
"111302.64933943081996");
24+
"111302.64933943082");
2525
$this->checkQueryResult(r\point(0.0, 1.0)->distance(r\point(1.0, 1.0), array("unit" => "km"))->coerceTo("STRING"),
26-
"111.30264933943082895");
26+
"111.30264933943083");
2727

2828
$this->checkQueryResult(r\polygon(array(array(0.0, 0.0), array(0.0, 1.0), array(1.0, 1.0)))->intersects(r\line(array(array(0.0, 0.0), array(2.0, 2.0)))),
2929
true);

0 commit comments

Comments
 (0)