Skip to content

Commit 36aff17

Browse files
committed
add fix
1 parent 6089254 commit 36aff17

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

tests/_support/Config/Registrar.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -134,9 +134,9 @@ public static function Database(): array
134134

135135
// Under GitHub Actions, we can set an ENV var named 'DB'
136136
// so that we can test against multiple databases.
137-
if (($group = getenv('DB')) && isset(self::$dbConfig[$group])) {
138-
$config['tests'] = self::$dbConfig[$group];
139-
}
137+
$group = env('DB', 'SQLite3');
138+
139+
$config['tests'] = self::$dbConfig[$group] ?? [];
140140

141141
return $config;
142142
}

tests/system/Commands/Database/MigrateStatusTest.php

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,11 @@ final class MigrateStatusTest extends CIUnitTestCase
3232

3333
protected function setUp(): void
3434
{
35-
$forge = Database::forge();
36-
$forge->dropTable('foo', true);
37-
3835
parent::setUp();
3936

37+
Database::connect()->table('migrations')->emptyTable();
38+
Database::forge()->dropTable('foo', true);
39+
4040
if (! is_file($this->migrationFileFrom)) {
4141
$this->fail(clean_path($this->migrationFileFrom) . ' is not found.');
4242
}
@@ -63,8 +63,7 @@ protected function tearDown(): void
6363
{
6464
parent::tearDown();
6565

66-
$db = db_connect();
67-
$db->table('migrations')->emptyTable();
66+
Database::connect()->table('migrations')->emptyTable();
6867

6968
if (is_file($this->migrationFileTo)) {
7069
@unlink($this->migrationFileTo);

0 commit comments

Comments
 (0)