@@ -395,6 +395,7 @@ public function testGetTables()
395395 {
396396 DB ::connection ('mongodb ' )->table ('newcollection ' )->insert (['test ' => 'value ' ]);
397397 DB ::connection ('mongodb ' )->table ('newcollection_two ' )->insert (['test ' => 'value ' ]);
398+ $ dbName = DB ::connection ('mongodb ' )->getDatabaseName ();
398399
399400 $ tables = Schema::getTables ();
400401 $ this ->assertIsArray ($ tables );
@@ -403,9 +404,13 @@ public function testGetTables()
403404 foreach ($ tables as $ table ) {
404405 $ this ->assertArrayHasKey ('name ' , $ table );
405406 $ this ->assertArrayHasKey ('size ' , $ table );
407+ $ this ->assertArrayHasKey ('schema ' , $ table );
408+ $ this ->assertArrayHasKey ('schema_qualified_name ' , $ table );
406409
407410 if ($ table ['name ' ] === 'newcollection ' ) {
408411 $ this ->assertEquals (8192 , $ table ['size ' ]);
412+ $ this ->assertEquals ($ dbName , $ table ['schema ' ]);
413+ $ this ->assertEquals ($ dbName . '.newcollection ' , $ table ['schema_qualified_name ' ]);
409414 $ found = true ;
410415 }
411416 }
@@ -428,6 +433,27 @@ public function testGetTableListing()
428433 $ this ->assertContains ('newcollection_two ' , $ tables );
429434 }
430435
436+ public function testGetTableListingBySchema ()
437+ {
438+ DB ::connection ('mongodb ' )->table ('newcollection ' )->insert (['test ' => 'value ' ]);
439+ DB ::connection ('mongodb ' )->table ('newcollection_two ' )->insert (['test ' => 'value ' ]);
440+ $ dbName = DB ::connection ('mongodb ' )->getDatabaseName ();
441+
442+ $ tables = Schema::getTableListing ([$ dbName , 'database__that_does_not_exists ' ], schemaQualified: true );
443+
444+ $ this ->assertIsArray ($ tables );
445+ $ this ->assertGreaterThanOrEqual (2 , count ($ tables ));
446+ $ this ->assertContains ($ dbName . '.newcollection ' , $ tables );
447+ $ this ->assertContains ($ dbName . '.newcollection_two ' , $ tables );
448+
449+ $ tables = Schema::getTableListing ([$ dbName , 'database__that_does_not_exists ' ], schemaQualified: false );
450+
451+ $ this ->assertIsArray ($ tables );
452+ $ this ->assertGreaterThanOrEqual (2 , count ($ tables ));
453+ $ this ->assertContains ('newcollection ' , $ tables );
454+ $ this ->assertContains ('newcollection_two ' , $ tables );
455+ }
456+
431457 public function testGetColumns ()
432458 {
433459 $ collection = DB ::connection ('mongodb ' )->table ('newcollection ' );
0 commit comments