mirror of
https://github.com/macintoshplus/mongo-php-driver.git
synced 2026-03-25 17:32:28 +01:00
* 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
163 lines
2.5 KiB
PHP
163 lines
2.5 KiB
PHP
--TEST--
|
|
MongoDB\Driver\BulkWrite debug output before execution
|
|
--FILE--
|
|
<?php
|
|
|
|
$tests = [
|
|
[],
|
|
['ordered' => true],
|
|
['ordered' => false],
|
|
['bypassDocumentValidation' => true],
|
|
['bypassDocumentValidation' => false],
|
|
['comment' => ['foo' => 1]],
|
|
['let' => ['id' => 1, 'x' => 'foo']],
|
|
];
|
|
|
|
foreach ($tests as $options) {
|
|
var_dump(new MongoDB\Driver\BulkWrite($options));
|
|
}
|
|
|
|
?>
|
|
===DONE===
|
|
<?php exit(0); ?>
|
|
--EXPECTF--
|
|
object(MongoDB\Driver\BulkWrite)#%d (%d) {
|
|
["database"]=>
|
|
NULL
|
|
["collection"]=>
|
|
NULL
|
|
["ordered"]=>
|
|
bool(true)
|
|
["bypassDocumentValidation"]=>
|
|
NULL
|
|
["executed"]=>
|
|
bool(false)
|
|
["server_id"]=>
|
|
int(0)
|
|
["session"]=>
|
|
NULL
|
|
["write_concern"]=>
|
|
NULL
|
|
}
|
|
object(MongoDB\Driver\BulkWrite)#%d (%d) {
|
|
["database"]=>
|
|
NULL
|
|
["collection"]=>
|
|
NULL
|
|
["ordered"]=>
|
|
bool(true)
|
|
["bypassDocumentValidation"]=>
|
|
NULL
|
|
["executed"]=>
|
|
bool(false)
|
|
["server_id"]=>
|
|
int(0)
|
|
["session"]=>
|
|
NULL
|
|
["write_concern"]=>
|
|
NULL
|
|
}
|
|
object(MongoDB\Driver\BulkWrite)#%d (%d) {
|
|
["database"]=>
|
|
NULL
|
|
["collection"]=>
|
|
NULL
|
|
["ordered"]=>
|
|
bool(false)
|
|
["bypassDocumentValidation"]=>
|
|
NULL
|
|
["executed"]=>
|
|
bool(false)
|
|
["server_id"]=>
|
|
int(0)
|
|
["session"]=>
|
|
NULL
|
|
["write_concern"]=>
|
|
NULL
|
|
}
|
|
object(MongoDB\Driver\BulkWrite)#%d (%d) {
|
|
["database"]=>
|
|
NULL
|
|
["collection"]=>
|
|
NULL
|
|
["ordered"]=>
|
|
bool(true)
|
|
["bypassDocumentValidation"]=>
|
|
bool(true)
|
|
["executed"]=>
|
|
bool(false)
|
|
["server_id"]=>
|
|
int(0)
|
|
["session"]=>
|
|
NULL
|
|
["write_concern"]=>
|
|
NULL
|
|
}
|
|
object(MongoDB\Driver\BulkWrite)#%d (%d) {
|
|
["database"]=>
|
|
NULL
|
|
["collection"]=>
|
|
NULL
|
|
["ordered"]=>
|
|
bool(true)
|
|
["bypassDocumentValidation"]=>
|
|
bool(false)
|
|
["executed"]=>
|
|
bool(false)
|
|
["server_id"]=>
|
|
int(0)
|
|
["session"]=>
|
|
NULL
|
|
["write_concern"]=>
|
|
NULL
|
|
}
|
|
object(MongoDB\Driver\BulkWrite)#%d (%d) {
|
|
["database"]=>
|
|
NULL
|
|
["collection"]=>
|
|
NULL
|
|
["ordered"]=>
|
|
bool(true)
|
|
["bypassDocumentValidation"]=>
|
|
NULL
|
|
["comment"]=>
|
|
object(stdClass)#%d (%d) {
|
|
["foo"]=>
|
|
int(1)
|
|
}
|
|
["executed"]=>
|
|
bool(false)
|
|
["server_id"]=>
|
|
int(0)
|
|
["session"]=>
|
|
NULL
|
|
["write_concern"]=>
|
|
NULL
|
|
}
|
|
object(MongoDB\Driver\BulkWrite)#%d (%d) {
|
|
["database"]=>
|
|
NULL
|
|
["collection"]=>
|
|
NULL
|
|
["ordered"]=>
|
|
bool(true)
|
|
["bypassDocumentValidation"]=>
|
|
NULL
|
|
["let"]=>
|
|
object(stdClass)#%d (%d) {
|
|
["id"]=>
|
|
int(1)
|
|
["x"]=>
|
|
string(3) "foo"
|
|
}
|
|
["executed"]=>
|
|
bool(false)
|
|
["server_id"]=>
|
|
int(0)
|
|
["session"]=>
|
|
NULL
|
|
["write_concern"]=>
|
|
NULL
|
|
}
|
|
===DONE===
|