File tree Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ class Client
28
28
* @param array $options Additional connection string options
29
29
* @param array $driverOptions Driver-specific options
30
30
*/
31
- public function __construct ($ uri , array $ options = [], array $ driverOptions = [])
31
+ public function __construct ($ uri = ' mongodb://localhost:27017 ' , array $ options = [], array $ driverOptions = [])
32
32
{
33
33
$ this ->manager = new Manager ($ uri , $ options , $ driverOptions );
34
34
$ this ->uri = (string ) $ uri ;
Original file line number Diff line number Diff line change 9
9
*/
10
10
class ClientTest extends TestCase
11
11
{
12
+ public function testConstructorDefaultUri ()
13
+ {
14
+ $ client = new Client ();
15
+
16
+ $ this ->assertEquals ('mongodb://localhost:27017 ' , (string ) $ client );
17
+ }
18
+
12
19
public function testToString ()
13
20
{
14
21
$ client = new Client ($ this ->getUri ());
You can’t perform that action at this time.
0 commit comments