⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.23
Server IP:
178.33.27.10
Server:
Linux cpanel.dev-unit.com 3.10.0-1160.108.1.el7.x86_64 #1 SMP Thu Jan 25 16:17:31 UTC 2024 x86_64
Server Software:
Apache/2.4.57 (Unix) OpenSSL/1.0.2k-fips
PHP Version:
8.2.11
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
usr
/
local
/
src
/
mongodb-1.11.1
/
tests
/
manager
/
View File Name :
manager-ctor_error-003.phpt
--TEST-- MongoDB\Driver\Manager::__construct(): invalid types in URI options arrays --FILE-- <?php require_once __DIR__ . '/../utils/basic.inc'; /* Note: generic boolean options (e.g. "ssl") are not tested because the driver * uses bson_iter_as_bool() to cast the value to a boolean for assignment. * * Read concern, read preference, and write concern options are tested in their * respective test files. */ echo "Testing 32-bit integer options:\n"; $integerOptions = [ 'connectTimeoutMS', 'heartbeatFrequencyMS', 'localThresholdMS', 'serverSelectionTimeoutMS', 'socketCheckIntervalMS', 'socketTimeoutMS', ]; $invalidIntegerValues = [ true, 1.0, 'string', new MongoDB\BSON\ObjectId, [ 1, 2, 3 ], ['x' => 1], ]; foreach ($integerOptions as $option) { foreach ($invalidIntegerValues as $value) { echo throws(function() use ($option, $value) { create_test_manager(null, [$option => $value]); }, "MongoDB\Driver\Exception\InvalidArgumentException"), "\n"; } } echo "\nTesting string options:\n"; $stringOptions = [ 'appname', 'authMechanism', 'authSource', 'gssapiServiceName', 'password', 'replicaSet', 'username', ]; $invalidStringValues = [ true, 1.0, 42, new MongoDB\BSON\ObjectId, [ 1, 2, 3 ], ['x' => 1], ]; foreach ($stringOptions as $option) { foreach ($invalidStringValues as $value) { echo throws(function() use ($option, $value) { create_test_manager(null, [$option => $value]); }, "MongoDB\Driver\Exception\InvalidArgumentException"), "\n"; } } echo "\nTesting document options:\n"; $invalidDocumentValues = [ true, 1.0, 42, 'string', new MongoDB\BSON\ObjectId, [ 1, 2, 3 ], ]; foreach ($invalidDocumentValues as $value) { echo throws(function() use ($value) { create_test_manager(null, ['authMechanismProperties' => $value]); }, "MongoDB\Driver\Exception\InvalidArgumentException"), "\n"; } ?> ===DONE=== <?php exit(0); ?> --EXPECT-- Testing 32-bit integer options: OK: Got MongoDB\Driver\Exception\InvalidArgumentException Expected 32-bit integer for "connectTimeoutMS" URI option, boolean given OK: Got MongoDB\Driver\Exception\InvalidArgumentException Expected 32-bit integer for "connectTimeoutMS" URI option, double given OK: Got MongoDB\Driver\Exception\InvalidArgumentException Expected 32-bit integer for "connectTimeoutMS" URI option, string given OK: Got MongoDB\Driver\Exception\InvalidArgumentException Expected 32-bit integer for "connectTimeoutMS" URI option, ObjectId given OK: Got MongoDB\Driver\Exception\InvalidArgumentException Expected 32-bit integer for "connectTimeoutMS" URI option, array given OK: Got MongoDB\Driver\Exception\InvalidArgumentException Expected 32-bit integer for "connectTimeoutMS" URI option, document given OK: Got MongoDB\Driver\Exception\InvalidArgumentException Expected 32-bit integer for "heartbeatFrequencyMS" URI option, boolean given OK: Got MongoDB\Driver\Exception\InvalidArgumentException Expected 32-bit integer for "heartbeatFrequencyMS" URI option, double given OK: Got MongoDB\Driver\Exception\InvalidArgumentException Expected 32-bit integer for "heartbeatFrequencyMS" URI option, string given OK: Got MongoDB\Driver\Exception\InvalidArgumentException Expected 32-bit integer for "heartbeatFrequencyMS" URI option, ObjectId given OK: Got MongoDB\Driver\Exception\InvalidArgumentException Expected 32-bit integer for "heartbeatFrequencyMS" URI option, array given OK: Got MongoDB\Driver\Exception\InvalidArgumentException Expected 32-bit integer for "heartbeatFrequencyMS" URI option, document given OK: Got MongoDB\Driver\Exception\InvalidArgumentException Expected 32-bit integer for "localThresholdMS" URI option, boolean given OK: Got MongoDB\Driver\Exception\InvalidArgumentException Expected 32-bit integer for "localThresholdMS" URI option, double given OK: Got MongoDB\Driver\Exception\InvalidArgumentException Expected 32-bit integer for "localThresholdMS" URI option, string given OK: Got MongoDB\Driver\Exception\InvalidArgumentException Expected 32-bit integer for "localThresholdMS" URI option, ObjectId given OK: Got MongoDB\Driver\Exception\InvalidArgumentException Expected 32-bit integer for "localThresholdMS" URI option, array given OK: Got MongoDB\Driver\Exception\InvalidArgumentException Expected 32-bit integer for "localThresholdMS" URI option, document given OK: Got MongoDB\Driver\Exception\InvalidArgumentException Expected 32-bit integer for "serverSelectionTimeoutMS" URI option, boolean given OK: Got MongoDB\Driver\Exception\InvalidArgumentException Expected 32-bit integer for "serverSelectionTimeoutMS" URI option, double given OK: Got MongoDB\Driver\Exception\InvalidArgumentException Expected 32-bit integer for "serverSelectionTimeoutMS" URI option, string given OK: Got MongoDB\Driver\Exception\InvalidArgumentException Expected 32-bit integer for "serverSelectionTimeoutMS" URI option, ObjectId given OK: Got MongoDB\Driver\Exception\InvalidArgumentException Expected 32-bit integer for "serverSelectionTimeoutMS" URI option, array given OK: Got MongoDB\Driver\Exception\InvalidArgumentException Expected 32-bit integer for "serverSelectionTimeoutMS" URI option, document given OK: Got MongoDB\Driver\Exception\InvalidArgumentException Expected 32-bit integer for "socketCheckIntervalMS" URI option, boolean given OK: Got MongoDB\Driver\Exception\InvalidArgumentException Expected 32-bit integer for "socketCheckIntervalMS" URI option, double given OK: Got MongoDB\Driver\Exception\InvalidArgumentException Expected 32-bit integer for "socketCheckIntervalMS" URI option, string given OK: Got MongoDB\Driver\Exception\InvalidArgumentException Expected 32-bit integer for "socketCheckIntervalMS" URI option, ObjectId given OK: Got MongoDB\Driver\Exception\InvalidArgumentException Expected 32-bit integer for "socketCheckIntervalMS" URI option, array given OK: Got MongoDB\Driver\Exception\InvalidArgumentException Expected 32-bit integer for "socketCheckIntervalMS" URI option, document given OK: Got MongoDB\Driver\Exception\InvalidArgumentException Expected 32-bit integer for "socketTimeoutMS" URI option, boolean given OK: Got MongoDB\Driver\Exception\InvalidArgumentException Expected 32-bit integer for "socketTimeoutMS" URI option, double given OK: Got MongoDB\Driver\Exception\InvalidArgumentException Expected 32-bit integer for "socketTimeoutMS" URI option, string given OK: Got MongoDB\Driver\Exception\InvalidArgumentException Expected 32-bit integer for "socketTimeoutMS" URI option, ObjectId given OK: Got MongoDB\Driver\Exception\InvalidArgumentException Expected 32-bit integer for "socketTimeoutMS" URI option, array given OK: Got MongoDB\Driver\Exception\InvalidArgumentException Expected 32-bit integer for "socketTimeoutMS" URI option, document given Testing string options: OK: Got MongoDB\Driver\Exception\InvalidArgumentException Expected string for "appname" URI option, boolean given OK: Got MongoDB\Driver\Exception\InvalidArgumentException Expected string for "appname" URI option, double given OK: Got MongoDB\Driver\Exception\InvalidArgumentException Expected string for "appname" URI option, 32-bit integer given OK: Got MongoDB\Driver\Exception\InvalidArgumentException Expected string for "appname" URI option, ObjectId given OK: Got MongoDB\Driver\Exception\InvalidArgumentException Expected string for "appname" URI option, array given OK: Got MongoDB\Driver\Exception\InvalidArgumentException Expected string for "appname" URI option, document given OK: Got MongoDB\Driver\Exception\InvalidArgumentException Expected string for "authMechanism" URI option, boolean given OK: Got MongoDB\Driver\Exception\InvalidArgumentException Expected string for "authMechanism" URI option, double given OK: Got MongoDB\Driver\Exception\InvalidArgumentException Expected string for "authMechanism" URI option, 32-bit integer given OK: Got MongoDB\Driver\Exception\InvalidArgumentException Expected string for "authMechanism" URI option, ObjectId given OK: Got MongoDB\Driver\Exception\InvalidArgumentException Expected string for "authMechanism" URI option, array given OK: Got MongoDB\Driver\Exception\InvalidArgumentException Expected string for "authMechanism" URI option, document given OK: Got MongoDB\Driver\Exception\InvalidArgumentException Expected string for "authSource" URI option, boolean given OK: Got MongoDB\Driver\Exception\InvalidArgumentException Expected string for "authSource" URI option, double given OK: Got MongoDB\Driver\Exception\InvalidArgumentException Expected string for "authSource" URI option, 32-bit integer given OK: Got MongoDB\Driver\Exception\InvalidArgumentException Expected string for "authSource" URI option, ObjectId given OK: Got MongoDB\Driver\Exception\InvalidArgumentException Expected string for "authSource" URI option, array given OK: Got MongoDB\Driver\Exception\InvalidArgumentException Expected string for "authSource" URI option, document given OK: Got MongoDB\Driver\Exception\InvalidArgumentException Expected string for "gssapiServiceName" URI option, boolean given OK: Got MongoDB\Driver\Exception\InvalidArgumentException Expected string for "gssapiServiceName" URI option, double given OK: Got MongoDB\Driver\Exception\InvalidArgumentException Expected string for "gssapiServiceName" URI option, 32-bit integer given OK: Got MongoDB\Driver\Exception\InvalidArgumentException Expected string for "gssapiServiceName" URI option, ObjectId given OK: Got MongoDB\Driver\Exception\InvalidArgumentException Expected string for "gssapiServiceName" URI option, array given OK: Got MongoDB\Driver\Exception\InvalidArgumentException Expected string for "gssapiServiceName" URI option, document given OK: Got MongoDB\Driver\Exception\InvalidArgumentException Expected string for "password" URI option, boolean given OK: Got MongoDB\Driver\Exception\InvalidArgumentException Expected string for "password" URI option, double given OK: Got MongoDB\Driver\Exception\InvalidArgumentException Expected string for "password" URI option, 32-bit integer given OK: Got MongoDB\Driver\Exception\InvalidArgumentException Expected string for "password" URI option, ObjectId given OK: Got MongoDB\Driver\Exception\InvalidArgumentException Expected string for "password" URI option, array given OK: Got MongoDB\Driver\Exception\InvalidArgumentException Expected string for "password" URI option, document given OK: Got MongoDB\Driver\Exception\InvalidArgumentException Expected string for "replicaSet" URI option, boolean given OK: Got MongoDB\Driver\Exception\InvalidArgumentException Expected string for "replicaSet" URI option, double given OK: Got MongoDB\Driver\Exception\InvalidArgumentException Expected string for "replicaSet" URI option, 32-bit integer given OK: Got MongoDB\Driver\Exception\InvalidArgumentException Expected string for "replicaSet" URI option, ObjectId given OK: Got MongoDB\Driver\Exception\InvalidArgumentException Expected string for "replicaSet" URI option, array given OK: Got MongoDB\Driver\Exception\InvalidArgumentException Expected string for "replicaSet" URI option, document given OK: Got MongoDB\Driver\Exception\InvalidArgumentException Expected string for "username" URI option, boolean given OK: Got MongoDB\Driver\Exception\InvalidArgumentException Expected string for "username" URI option, double given OK: Got MongoDB\Driver\Exception\InvalidArgumentException Expected string for "username" URI option, 32-bit integer given OK: Got MongoDB\Driver\Exception\InvalidArgumentException Expected string for "username" URI option, ObjectId given OK: Got MongoDB\Driver\Exception\InvalidArgumentException Expected string for "username" URI option, array given OK: Got MongoDB\Driver\Exception\InvalidArgumentException Expected string for "username" URI option, document given Testing document options: OK: Got MongoDB\Driver\Exception\InvalidArgumentException Expected array or object for "authMechanismProperties" URI option, boolean given OK: Got MongoDB\Driver\Exception\InvalidArgumentException Expected array or object for "authMechanismProperties" URI option, double given OK: Got MongoDB\Driver\Exception\InvalidArgumentException Expected array or object for "authMechanismProperties" URI option, 32-bit integer given OK: Got MongoDB\Driver\Exception\InvalidArgumentException Expected array or object for "authMechanismProperties" URI option, string given OK: Got MongoDB\Driver\Exception\InvalidArgumentException Expected array or object for "authMechanismProperties" URI option, ObjectId given OK: Got MongoDB\Driver\Exception\InvalidArgumentException Expected array or object for "authMechanismProperties" URI option, array given ===DONE===