mirror of
https://github.com/macintoshplus/mongo-php-driver.git
synced 2026-03-25 17:32:28 +01:00
29 lines
643 B
PHP
29 lines
643 B
PHP
--TEST--
|
|
MongoDB\Driver\ReadPreference::getModeString()
|
|
--FILE--
|
|
<?php
|
|
|
|
$tests = [
|
|
MongoDB\Driver\ReadPreference::RP_PRIMARY,
|
|
MongoDB\Driver\ReadPreference::RP_PRIMARY_PREFERRED,
|
|
MongoDB\Driver\ReadPreference::RP_SECONDARY,
|
|
MongoDB\Driver\ReadPreference::RP_SECONDARY_PREFERRED,
|
|
MongoDB\Driver\ReadPreference::RP_NEAREST,
|
|
];
|
|
|
|
foreach ($tests as $test) {
|
|
$rp = new MongoDB\Driver\ReadPreference($test);
|
|
var_dump($rp->getModeString());
|
|
}
|
|
|
|
?>
|
|
===DONE===
|
|
<?php exit(0); ?>
|
|
--EXPECT--
|
|
string(7) "primary"
|
|
string(16) "primaryPreferred"
|
|
string(9) "secondary"
|
|
string(18) "secondaryPreferred"
|
|
string(7) "nearest"
|
|
===DONE===
|