Viewing File: /opt/alt/tests/alt-php81-pecl-mongodb_1.18.1-1.el8/tests/bson-javascript_error-003.phpt

--TEST--
MongoDB\BSON\Javascript::__construct() does not allow code to contain null bytes
--FILE--
<?php

require_once __DIR__ . '/../utils/basic.inc';

echo throws(function() {
    new MongoDB\BSON\Javascript("function() { return '\0'; }");
}, 'MongoDB\Driver\Exception\InvalidArgumentException'), "\n";

?>
===DONE===
<?php exit(0); ?>
--EXPECT--
OK: Got MongoDB\Driver\Exception\InvalidArgumentException
Code cannot contain null bytes
===DONE===
Back to Directory File Manager
<