File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed
src/Symfony/Component/Lock/Tests/Store Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -141,4 +141,28 @@ public function provideInvalidConstructorArgs()
141
141
yield ['mongodb://localhost/test ' , []];
142
142
yield ['mongodb://localhost/ ' , []];
143
143
}
144
+
145
+ public function testCollectionDsnPrecedence ()
146
+ {
147
+ $ client = self ::getMongoClient ();
148
+
149
+ $ store = new MongoDbStore ('mongodb://localhost/test?collection=lock_dsn ' , ['collection ' => 'lock_option ' ]);
150
+ $ r = new \ReflectionObject ($ store );
151
+ $ p = $ r ->getProperty ('options ' );
152
+ $ p ->setAccessible (true );
153
+ $ options = $ p ->getValue ($ store );
154
+ $ this ->assertSame ('lock_dsn ' , $ options ['collection ' ]);
155
+ }
156
+
157
+ public function testDatabaseDsnPrecedence ()
158
+ {
159
+ $ client = self ::getMongoClient ();
160
+
161
+ $ store = new MongoDbStore ('mongodb://localhost/test_dsn ' , ['database ' => 'test_option ' ]);
162
+ $ r = new \ReflectionObject ($ store );
163
+ $ p = $ r ->getProperty ('options ' );
164
+ $ p ->setAccessible (true );
165
+ $ options = $ p ->getValue ($ store );
166
+ $ this ->assertSame ('test_dsn ' , $ options ['database ' ]);
167
+ }
144
168
}
You can’t perform that action at this time.
0 commit comments