Page MenuHomePhabricator (Chris)

query-ctor-comment_error-001.phpt
No OneTemporary

Authored By
Unknown
Size
576 B
Referenced Files
None
Subscribers
None

query-ctor-comment_error-001.phpt

--TEST--
MongoDB\Driver\Query::__construct(): comment option bsonSerialize() exception
--FILE--
<?php
require_once __DIR__ . "/../utils/basic.inc";
class Comment implements MongoDB\BSON\Serializable
{
#[\ReturnTypeWillChange]
public function bsonSerialize(): array
{
throw new Exception('phongo_zval_to_bson_value fails');
}
}
echo throws(function() {
new MongoDB\Driver\Query([], ['comment' => new Comment()]);
}, Exception::class), "\n";
?>
===DONE===
<?php exit(0); ?>
--EXPECT--
OK: Got Exception
phongo_zval_to_bson_value fails
===DONE===

File Metadata

Mime Type
application/javascript
Expires
Sun, Nov 15, 5:04 PM (1 d, 10 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
152495
Default Alt Text
query-ctor-comment_error-001.phpt (576 B)

Event Timeline