Linux SRV-16 6.18.44-paas #1 SMP PREEMPT_DYNAMIC Thu Aug 13 10:08:12 UTC 2026 x86_64
/
opt
/
php-8.2.24-202410171016
/
share
/
test
/
mongodb
/
tests
/
query
/
//opt/php-8.2.24-202410171016/share/test/mongodb/tests/query/query-ctor_error-007.phpt
--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===