mirror of
https://github.com/macintoshplus/mongo-php-driver.git
synced 2026-04-25 01:18:07 +02:00
19 lines
453 B
PHP
19 lines
453 B
PHP
--TEST--
|
|
MongoDB\BSON\Javascript::__construct() does not allow code to contain null bytes
|
|
--FILE--
|
|
<?php
|
|
|
|
require_once __DIR__ . '/../utils/tools.php';
|
|
|
|
echo throws(function() {
|
|
new MongoDB\BSON\Javascript("function foo() { return '\0'; }");
|
|
}, 'MongoDB\Driver\Exception\InvalidArgumentException'), "\n";
|
|
|
|
?>
|
|
===DONE===
|
|
<?php exit(0); ?>
|
|
--EXPECT--
|
|
OK: Got MongoDB\Driver\Exception\InvalidArgumentException
|
|
Code cannot contain null bytes
|
|
===DONE===
|