@@ -61,6 +61,9 @@ final class Operation
61
61
/** @var string|null */
62
62
private $ databaseName ;
63
63
64
+ /** @var array */
65
+ private $ databaseOptions = [];
66
+
64
67
/** @var string */
65
68
private $ name ;
66
69
@@ -191,6 +194,14 @@ public static function fromReadWriteConcern(stdClass $operation)
191
194
$ o ->errorExpectation = ErrorExpectation::fromReadWriteConcern ($ operation );
192
195
$ o ->resultExpectation = ResultExpectation::fromReadWriteConcern ($ operation , $ o ->getResultAssertionType ());
193
196
197
+ if (isset ($ operation ->databaseOptions )) {
198
+ $ o ->databaseOptions = (array ) $ operation ->databaseOptions ;
199
+ }
200
+
201
+ if (isset ($ operation ->collectionOptions )) {
202
+ $ o ->collectionOptions = (array ) $ operation ->collectionOptions ;
203
+ }
204
+
194
205
return $ o ;
195
206
}
196
207
@@ -287,7 +298,7 @@ private function execute(FunctionalTestCase $test, Context $context)
287
298
288
299
return $ this ->executeForClient ($ client , $ context );
289
300
case self ::OBJECT_COLLECTION :
290
- $ collection = $ context ->getCollection ($ this ->collectionOptions );
301
+ $ collection = $ context ->getCollection ($ this ->collectionOptions , $ this -> databaseOptions );
291
302
292
303
return $ this ->executeForCollection ($ collection , $ context );
293
304
case self ::OBJECT_DATABASE :
@@ -299,7 +310,7 @@ private function execute(FunctionalTestCase $test, Context $context)
299
310
300
311
return $ this ->executeForGridFSBucket ($ bucket , $ context );
301
312
case self ::OBJECT_SELECT_COLLECTION :
302
- $ collection = $ context ->selectCollection ($ this ->databaseName , $ this ->collectionName , $ this ->collectionOptions );
313
+ $ collection = $ context ->selectCollection ($ this ->databaseName , $ this ->collectionName , $ this ->collectionOptions , $ this -> databaseOptions );
303
314
304
315
return $ this ->executeForCollection ($ collection , $ context );
305
316
case self ::OBJECT_SELECT_DATABASE :
0 commit comments