@@ -18,21 +18,27 @@ public function testShouldImplementConnectionFactoryInterface()
18
18
19
19
public function testCouldBeConstructedWithEmptyConfiguration ()
20
20
{
21
+ $ params = [
22
+ 'uri ' => 'mongodb://127.0.0.1/ ' ,
23
+ 'uriOptions ' => [],
24
+ 'driverOptions ' => [],
25
+ ];
26
+
21
27
$ factory = new MongodbConnectionFactory ();
22
- $ this ->assertAttributeEquals ('mongodb://127.0.0.1/ ' , 'uri ' , $ factory );
23
- $ this ->assertAttributeEquals ([], 'config ' , $ factory );
24
- $ this ->assertAttributeEquals ([], 'uriOptions ' , $ factory );
25
- $ this ->assertAttributeEquals ([], 'driverOptions ' , $ factory );
28
+ $ this ->assertAttributeEquals ($ params , 'config ' , $ factory );
26
29
}
27
30
28
31
public function testCouldBeConstructedWithCustomConfiguration ()
29
32
{
30
- $ factory = new MongodbConnectionFactory ('mongodb://127.0.0.3/ ' , ['testValue ' => 123 ], ['testValue ' => 123 ], ['testValue ' => 123 ]);
33
+ $ params = [
34
+ 'uri ' => 'mongodb://127.0.0.3/ ' ,
35
+ 'uriOptions ' => ['testValue ' => 123 ],
36
+ 'driverOptions ' => ['testValue ' => 123 ],
37
+ ];
38
+
39
+ $ factory = new MongodbConnectionFactory ($ params );
31
40
32
- $ this ->assertAttributeEquals ('mongodb://127.0.0.3/ ' , 'uri ' , $ factory );
33
- $ this ->assertAttributeEquals (['testValue ' => 123 ], 'config ' , $ factory );
34
- $ this ->assertAttributeEquals (['testValue ' => 123 ], 'uriOptions ' , $ factory );
35
- $ this ->assertAttributeEquals (['testValue ' => 123 ], 'driverOptions ' , $ factory );
41
+ $ this ->assertAttributeEquals ($ params , 'config ' , $ factory );
36
42
}
37
43
38
44
public function testShouldCreateContext ()
0 commit comments