Skip to content

Commit db43bbb

Browse files
masterbaterGromNaN
authored andcommitted
fix: follow master jmikola suggestions
1 parent 7655583 commit db43bbb

File tree

3 files changed

+3
-13
lines changed

3 files changed

+3
-13
lines changed

phpunit.xml.dist

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
</testsuite>
1818
</testsuites>
1919
<php>
20-
<env name="MONGODB_URI" value="mongodb://127.0.0.1/?directConnection=true"/>
20+
<env name="MONGODB_URI" value="mongodb://mongodb/?directConnection=true"/>
2121
<env name="MONGODB_DATABASE" value="unittest"/>
2222
<env name="SQLITE_DATABASE" value=":memory:"/>
2323
<env name="QUEUE_CONNECTION" value="database"/>

src/Schema/Builder.php

-10
Original file line numberDiff line numberDiff line change
@@ -152,11 +152,6 @@ public function getTables($schema = null)
152152
foreach ($db->listCollections() as $collectionInfo) {
153153
$collectionName = $collectionInfo->getName();
154154

155-
// Skip system collections
156-
if (str_starts_with($collectionName, 'system.')) {
157-
continue;
158-
}
159-
160155
// Skip views it doesnt suport aggregate
161156
if ($collectionInfo->getType() === 'view') {
162157
continue;
@@ -192,11 +187,6 @@ public function getViews($schema = null)
192187
foreach ($db->listCollections() as $collectionInfo) {
193188
$collectionName = $collectionInfo->getName();
194189

195-
// Skip system collections
196-
if (str_starts_with($collectionName, 'system.')) {
197-
continue;
198-
}
199-
200190
// Skip normal type collection
201191
if ($collectionInfo->getType() !== 'view') {
202192
continue;

tests/SchemaTest.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -420,7 +420,7 @@ public function testGetTables()
420420
}
421421

422422
// Ensure system collections are excluded
423-
$this->assertFalse(str_starts_with($table['name'], 'system.'));
423+
$this->assertStringStartsNotWith($table['name'], 'system.');
424424
}
425425

426426
if (! $found) {
@@ -516,7 +516,7 @@ public function testSystemCollectionsArePresentButFiltered()
516516
// Ensure Schema::getTables does NOT include system collections
517517
$tables = Schema::getTables();
518518
foreach ($tables as $table) {
519-
$this->assertFalse(str_starts_with($table['name'], 'system.'));
519+
$this->assertStringStartsNotWith($table['name'], 'system.');
520520
}
521521

522522
// Ensure Schema::getTableListing does NOT include system collections

0 commit comments

Comments
 (0)