mirror of
https://github.com/macintoshplus/mongo-php-driver.git
synced 2026-03-25 17:32:28 +01:00
42 lines
1.4 KiB
PHP
42 lines
1.4 KiB
PHP
--TEST--
|
|
MongoDB\Driver\Query construction (invalid readConcern type)
|
|
--FILE--
|
|
<?php
|
|
require_once __DIR__ . "/../utils/basic.inc";
|
|
|
|
$tests = [
|
|
1,
|
|
1.0,
|
|
'string',
|
|
true,
|
|
[],
|
|
new stdClass,
|
|
null,
|
|
];
|
|
|
|
foreach ($tests as $test) {
|
|
echo throws(function() use ($test) {
|
|
new MongoDB\Driver\Query([], ['readConcern' => $test]);
|
|
}, 'MongoDB\Driver\Exception\InvalidArgumentException'), "\n";
|
|
}
|
|
|
|
?>
|
|
===DONE===
|
|
<?php exit(0); ?>
|
|
--EXPECTF--
|
|
OK: Got MongoDB\Driver\Exception\InvalidArgumentException
|
|
Expected "readConcern" option to be MongoDB\Driver\ReadConcern, int%S given
|
|
OK: Got MongoDB\Driver\Exception\InvalidArgumentException
|
|
Expected "readConcern" option to be MongoDB\Driver\ReadConcern, %r(double|float)%r given
|
|
OK: Got MongoDB\Driver\Exception\InvalidArgumentException
|
|
Expected "readConcern" option to be MongoDB\Driver\ReadConcern, string given
|
|
OK: Got MongoDB\Driver\Exception\InvalidArgumentException
|
|
Expected "readConcern" option to be MongoDB\Driver\ReadConcern, bool%S given
|
|
OK: Got MongoDB\Driver\Exception\InvalidArgumentException
|
|
Expected "readConcern" option to be MongoDB\Driver\ReadConcern, array given
|
|
OK: Got MongoDB\Driver\Exception\InvalidArgumentException
|
|
Expected "readConcern" option to be MongoDB\Driver\ReadConcern, stdClass given
|
|
OK: Got MongoDB\Driver\Exception\InvalidArgumentException
|
|
Expected "readConcern" option to be MongoDB\Driver\ReadConcern, %r(null|NULL)%r given
|
|
===DONE===
|