Skip to content

Commit c865ba8

Browse files
committed
add fix
1 parent 6089254 commit c865ba8

File tree

3 files changed

+8
-9
lines changed

3 files changed

+8
-9
lines changed

.github/workflows/reusable-phpunit-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ jobs:
206206
- name: Run tests
207207
run: script -e -c "vendor/bin/phpunit --color=always ${{ env.EXTRA_PHPUNIT_OPTIONS }}"
208208
env:
209-
# DB: ${{ inputs.db-platform }}
209+
DB: ${{ inputs.db-platform }}
210210
TACHYCARDIA_MONITOR_GA: ${{ inputs.enable-profiling && 'enabled' || '' }}
211211
TERM: xterm-256color
212212

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)