File manager - Edit - /opt/cpanel/ea-php74/root/usr/share/tests/pecl/mongodb/tests/query/query-ctor_error-007.phpt
Back
--TEST-- MongoDB\Driver\Query::__construct() prohibits PackedArray for document values --FILE-- <?php require_once __DIR__ . '/../utils/basic.inc'; echo throws(function() { new MongoDB\Driver\Query(MongoDB\BSON\PackedArray::fromPHP([])); }, MongoDB\Driver\Exception\UnexpectedValueException::class), "\n"; $tests = [ ['collation' => MongoDB\BSON\PackedArray::fromPHP([])], ['let' => MongoDB\BSON\PackedArray::fromPHP([])], ['max' => MongoDB\BSON\PackedArray::fromPHP([])], ['min' => MongoDB\BSON\PackedArray::fromPHP([])], ['projection' => MongoDB\BSON\PackedArray::fromPHP([])], ['sort' => MongoDB\BSON\PackedArray::fromPHP([])], ['modifiers' => ['$max' => MongoDB\BSON\PackedArray::fromPHP([])]], ['modifiers' => ['$min' => MongoDB\BSON\PackedArray::fromPHP([])]], ['modifiers' => ['$orderby' => MongoDB\BSON\PackedArray::fromPHP([])]], ]; foreach ($tests as $options) { echo throws(function() use ($options) { new MongoDB\Driver\Query([], $options); }, MongoDB\Driver\Exception\UnexpectedValueException::class), "\n"; } ?> ===DONE=== <?php exit(0); ?> --EXPECTF-- OK: Got MongoDB\Driver\Exception\UnexpectedValueException MongoDB\BSON\PackedArray cannot be serialized as a root document OK: Got MongoDB\Driver\Exception\UnexpectedValueException MongoDB\BSON\PackedArray cannot be serialized as a root document OK: Got MongoDB\Driver\Exception\UnexpectedValueException MongoDB\BSON\PackedArray cannot be serialized as a root document OK: Got MongoDB\Driver\Exception\UnexpectedValueException MongoDB\BSON\PackedArray cannot be serialized as a root document OK: Got MongoDB\Driver\Exception\UnexpectedValueException MongoDB\BSON\PackedArray cannot be serialized as a root document OK: Got MongoDB\Driver\Exception\UnexpectedValueException MongoDB\BSON\PackedArray cannot be serialized as a root document OK: Got MongoDB\Driver\Exception\UnexpectedValueException MongoDB\BSON\PackedArray cannot be serialized as a root document Deprecated: MongoDB\Driver\Query::__construct(): The "modifiers" option is deprecated and will be removed in a future release in %s on line %d OK: Got MongoDB\Driver\Exception\UnexpectedValueException MongoDB\BSON\PackedArray cannot be serialized as a root document Deprecated: MongoDB\Driver\Query::__construct(): The "modifiers" option is deprecated and will be removed in a future release in %s on line %d OK: Got MongoDB\Driver\Exception\UnexpectedValueException MongoDB\BSON\PackedArray cannot be serialized as a root document Deprecated: MongoDB\Driver\Query::__construct(): The "modifiers" option is deprecated and will be removed in a future release in %s on line %d OK: Got MongoDB\Driver\Exception\UnexpectedValueException MongoDB\BSON\PackedArray cannot be serialized as a root document ===DONE===
| ver. 1.4 |
Github
|
.
| PHP 8.2.30 | Generation time: 0 |
proxy
|
phpinfo
|
Settings