Viewing File: /opt/alt/tests/alt-php83-pecl-mongodb_1.18.1-1.el8/tests/manager-ctor_error-004.phpt

--TEST--
MongoDB\Driver\Manager::__construct(): empty replicaSet argument
--FILE--
<?php
require_once __DIR__ . "/../utils/basic.inc";

echo throws(function () {
    $manager = create_test_manager('mongodb://localhost:27017/?replicaSet=');
    $manager->executeQuery(NS, new MongoDB\Driver\Query([]));
}, MongoDB\Driver\Exception\InvalidArgumentException::class), "\n";

echo throws(function () {
    $manager = create_test_manager('mongodb://localhost:27017', ['replicaSet' => '']);
    $manager->executeQuery(NS, new MongoDB\Driver\Query([]));
}, MongoDB\Driver\Exception\InvalidArgumentException::class), "\n";

?>
===DONE===
<?php exit(0); ?>
--EXPECT--
OK: Got MongoDB\Driver\Exception\InvalidArgumentException
Failed to parse MongoDB URI: 'mongodb://localhost:27017/?replicaSet='. Value for URI option "replicaset" cannot be empty string.
OK: Got MongoDB\Driver\Exception\InvalidArgumentException
Value for URI option "replicaSet" cannot be empty string.
===DONE===
Back to Directory File Manager
<