Files
mongo-php-driver/tests/query/query-debug-003.phpt
Jeremy Mikola db4fe3dc8b PHPC-2049: BulkWrite and Query support comment option of any type (#1320)
* PHPC-2049: Bump libmongoc and libmongocrypt submodules

libmongoc master (1.22-dev) now depends on libmongocrypt master (1.5-dev).

libmongoc's bundled zlib library was updated to 1.2.12.

* PHPC-2049: BulkWrite and Query support comment option of any type

MongoDB 4.4+ allows a comment option of any type on most commands. Previously, find required a string type and write commands did not support comment at all. The driver does not validate the option and relies on the server to raise an error.

* Fix title and variable access in BulkWrite and Query let option tests

* Fix grammar in php_phongo_bulkwrite_delete_apply_options comment

* Undefine additional Query option macros
2022-05-20 11:11:18 -04:00

51 lines
808 B
PHP

--TEST--
MongoDB\Driver\Query debug output with comment option
--FILE--
<?php
var_dump(new MongoDB\Driver\Query(
[],
['comment' => ['foo' => 1]]
));
var_dump(new MongoDB\Driver\Query(
[],
['modifiers' => ['$comment' => ['foo' => 1]]]
));
?>
===DONE===
<?php exit(0); ?>
--EXPECTF--
object(MongoDB\Driver\Query)#%d (%d) {
["filter"]=>
object(stdClass)#%d (0) {
}
["options"]=>
object(stdClass)#%d (%d) {
["comment"]=>
object(stdClass)#%d (%d) {
["foo"]=>
int(1)
}
}
["readConcern"]=>
NULL
}
object(MongoDB\Driver\Query)#%d (%d) {
["filter"]=>
object(stdClass)#%d (0) {
}
["options"]=>
object(stdClass)#%d (%d) {
["comment"]=>
object(stdClass)#%d (%d) {
["foo"]=>
int(1)
}
}
["readConcern"]=>
NULL
}
===DONE===