@@ -147,10 +147,16 @@ public function testCollectionDsnPrecedence()
147
147
$ client = self ::getMongoClient ();
148
148
149
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 );
150
+ $ storeReflection = new \ReflectionObject ($ store );
151
+
152
+ $ uriProperty = $ storeReflection ->getProperty ('uri ' );
153
+ $ uriProperty ->setAccessible (true );
154
+ $ uri = $ uriProperty ->getValue ($ store );
155
+ $ this ->assertSame ('mongodb://localhost/test ' , $ uri );
156
+
157
+ $ optionsProperty = $ storeReflection ->getProperty ('options ' );
158
+ $ optionsProperty ->setAccessible (true );
159
+ $ options = $ optionsProperty ->getValue ($ store );
154
160
$ this ->assertSame ('lock_dsn ' , $ options ['collection ' ]);
155
161
}
156
162
@@ -159,10 +165,10 @@ public function testDatabaseDsnPrecedence()
159
165
$ client = self ::getMongoClient ();
160
166
161
167
$ 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 );
168
+ $ storeReflection = new \ReflectionObject ($ store );
169
+ $ optionsProperty = $ storeReflection ->getProperty ('options ' );
170
+ $ optionsProperty ->setAccessible (true );
171
+ $ options = $ optionsProperty ->getValue ($ store );
166
172
$ this ->assertSame ('test_dsn ' , $ options ['database ' ]);
167
173
}
168
174
}
0 commit comments