📁 File Manager Pro
v10.0.3 | PHP: 7.4.33
Server: LiteSpeed
2026-07-12 03:50:38
📂
/ (Root)
/
opt
/
alt
/
tests
/
alt-php81-pecl-mongodb_1.18.1-1.el8
/
tests
📍 /opt/alt/tests/alt-php81-pecl-mongodb_1.18.1-1.el8/tests
🔄 Refresh
✏️
Editing: bson-utcdatetime_error-004.phpt
Read Only
--TEST-- MongoDB\BSON\UTCDateTime constructor requires integer or string argument --FILE-- <?php require_once __DIR__ . '/../utils/basic.inc'; /* UTCDateTime::__construct() internally converts floats to integers, so we will * not use a float to test for an invalid value. We also don't test an object, * since that is used for validating a possible DateTimeInterface argument. */ $invalidValues = [true, []]; foreach ($invalidValues as $invalidValue) { echo throws(function() use ($invalidValue) { new MongoDB\BSON\UTCDateTime($invalidValue); }, 'MongoDB\Driver\Exception\InvalidArgumentException'), "\n"; } ?> ===DONE=== <?php exit(0); ?> --EXPECT-- OK: Got MongoDB\Driver\Exception\InvalidArgumentException Expected integer or string, bool given OK: Got MongoDB\Driver\Exception\InvalidArgumentException Expected integer or string, array given ===DONE===
💾 Save Changes
❌ Cancel