@@ -396,6 +396,7 @@ public function testGetTables()
396
396
{
397
397
DB ::connection ('mongodb ' )->table ('newcollection ' )->insert (['test ' => 'value ' ]);
398
398
DB ::connection ('mongodb ' )->table ('newcollection_two ' )->insert (['test ' => 'value ' ]);
399
+ DB ::connection ('mongodb ' )->getDatabase ()->createCollection ('test_view ' , ['viewOn ' => 'newcollection ' ]);
399
400
$ dbName = DB ::connection ('mongodb ' )->getDatabaseName ();
400
401
401
402
$ tables = Schema::getTables ();
@@ -408,6 +409,9 @@ public function testGetTables()
408
409
$ this ->assertArrayHasKey ('schema ' , $ table );
409
410
$ this ->assertArrayHasKey ('schema_qualified_name ' , $ table );
410
411
412
+ // Ensure "test_view" is not in the tables list
413
+ $ this ->assertNotEquals ('test_view ' , $ table ['name ' ], 'Standard views should not be included in the result of getTables. ' );
414
+
411
415
if ($ table ['name ' ] === 'newcollection ' ) {
412
416
$ this ->assertEquals (8192 , $ table ['size ' ]);
413
417
$ this ->assertEquals ($ dbName , $ table ['schema ' ]);
@@ -440,6 +444,9 @@ public function testGetViews()
440
444
$ this ->assertArrayHasKey ('schema ' , $ table );
441
445
$ this ->assertArrayHasKey ('schema_qualified_name ' , $ table );
442
446
447
+ // Ensure "normal collections" are not in the views list
448
+ $ this ->assertNotEquals ('newcollection ' , $ table ['name ' ], 'Normal collections should not be included in the result of getViews. ' );
449
+
443
450
if ($ table ['name ' ] === 'test_view ' ) {
444
451
$ this ->assertEquals ($ dbName , $ table ['schema ' ]);
445
452
$ this ->assertEquals ($ dbName . '.test_view ' , $ table ['schema_qualified_name ' ]);
0 commit comments