Skip to content

Commit 0d2d153

Browse files
committed
Merge pull request #773
2 parents 291996b + a646b4e commit 0d2d153

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
--TEST--
2+
MongoDB\Driver\Manager::executeCommand() connection error
3+
--FILE--
4+
<?php
5+
require_once __DIR__ . "/../utils/tools.php";
6+
7+
$manager = new MongoDB\Driver\Manager("mongodb://localhost:44444/?serverselectiontimeoutms=10");
8+
9+
$command = new MongoDB\Driver\Command(['ping' => 1]);
10+
11+
echo throws(function() use($manager, $command) {
12+
$manager->executeCommand('test', $command);
13+
}, "MongoDB\Driver\Exception\ConnectionTimeoutException"), "\n";
14+
15+
?>
16+
===DONE===
17+
<?php exit(0); ?>
18+
--EXPECTF--
19+
OK: Got MongoDB\Driver\Exception\ConnectionTimeoutException
20+
No suitable servers found (`serverSelectionTryOnce` set): [connection refused calling ismaster on '%s']
21+
===DONE===

0 commit comments

Comments
 (0)