File: bug00487.phpt

package info (click to toggle)
php-mongo 1.5.7-1
  • links: PTS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 11,040 kB
  • ctags: 2,802
  • sloc: ansic: 17,632; xml: 2,195; php: 1,630; pascal: 330; makefile: 52; sh: 39
file content (34 lines) | stat: -rw-r--r-- 881 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
--TEST--
Test for PHP-487: Connect to replicaset member using standalone connection
--SKIPIF--
<?php require_once "tests/utils/replicaset.inc" ?>
--FILE--
<?php
require_once "tests/utils/server.inc";
$cfg = MongoShellServer::getReplicasetInfo();
$m = new Mongo($cfg["hosts"][2]);

try {
    $c = $m->selectDb(dbname())->test;
    $c->drop();
    var_dump($c->findOne());
} catch(Exception $e) {
    var_dump($e->getMessage());
}


$retval = $m->setSlaveOkay(true);
var_dump($retval);

$c = $m->selectDb(dbname())->test;
// We don't care about the data, just the fact we don't get an exception here
$c->findOne();
?>
===DONE===
--EXPECTF--
%s: %s(): The Mongo class is deprecated, please use the MongoClient class in %sbug00487.php on line %d
string(%d) "%s:%d: not master and slaveOk=false"

%s: Function Mongo::setSlaveOkay() is deprecated in %s on line %d
bool(false)
===DONE===