Page Menu
Home
Phabricator (Chris)
Search
Configure Global Search
Log In
Files
F627316
bulkwrite-ctor-let_error-001.phpt
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Authored By
Unknown
Size
1 KB
Referenced Files
None
Subscribers
None
bulkwrite-ctor-let_error-001.phpt
View Options
--TEST--
MongoDB\Driver\BulkWrite::__construct(): let option invalid type
--FILE--
<?php
require_once __DIR__ . '/../utils/basic.inc';
$invalidValues = [true, 1, 'string', null];
foreach ($invalidValues as $invalidValue) {
echo throws(function() use ($invalidValue) {
new MongoDB\Driver\BulkWrite(['let' => $invalidValue]);
}, MongoDB\Driver\Exception\InvalidArgumentException::class), "\n";
}
echo throws(function() {
new MongoDB\Driver\BulkWrite(['let' => MongoDB\BSON\PackedArray::fromPHP([])]);
}, MongoDB\Driver\Exception\UnexpectedValueException::class), "\n";
?>
===DONE===
<?php exit(0); ?>
--EXPECT--
OK: Got MongoDB\Driver\Exception\InvalidArgumentException
Expected "let" option to be array or object, bool given
OK: Got MongoDB\Driver\Exception\InvalidArgumentException
Expected "let" option to be array or object, int given
OK: Got MongoDB\Driver\Exception\InvalidArgumentException
Expected "let" option to be array or object, string given
OK: Got MongoDB\Driver\Exception\InvalidArgumentException
Expected "let" option to be array or object, null given
OK: Got MongoDB\Driver\Exception\UnexpectedValueException
MongoDB\BSON\PackedArray cannot be serialized as a root document
===DONE===
File Metadata
Details
Attached
Mime Type
application/javascript
Expires
Sun, Nov 15, 1:53 AM (14 h, 59 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
152017
Default Alt Text
bulkwrite-ctor-let_error-001.phpt (1 KB)
Attached To
Mode
R114 php-mongodb
Attached
Detach File
Event Timeline