Files
mongo-php-driver/tests/bson-corpus/document-decodeError-004.phpt
Jeremy Mikola 93bd10bd21 PHPC-1897: Test serialization of BSON with embedded null bytes in strings (#1255)
* BSON corpus prose tests for null bytes

For tests that already existed we just add a reference to the prose test

* BSON corpus tests for null bytes

Synced with mongodb/specifications@c64fc79899

This sync also removes some old DBRef tests, which should have been removed in 6929bcb608.

* Bump libmongoc to 1.19.1 to pull in changes from CDRIVER-4083
2021-10-25 13:27:33 -04:00

23 lines
516 B
PHP

--TEST--
Document type (sub-documents): Null byte in sub-document key
--DESCRIPTION--
Generated by scripts/convert-bson-corpus-tests.php
DO NOT EDIT THIS FILE
--FILE--
<?php
require_once __DIR__ . '/../utils/basic.inc';
$bson = hex2bin('150000000378000D00000010610000010000000000');
throws(function() use ($bson) {
var_dump(toPHP($bson));
}, 'MongoDB\Driver\Exception\UnexpectedValueException');
?>
===DONE===
<?php exit(0); ?>
--EXPECT--
OK: Got MongoDB\Driver\Exception\UnexpectedValueException
===DONE===