Skip to content

Commit

Permalink
Merge pull request #8393 from paulbalandan/leftover-db-files
Browse files Browse the repository at this point in the history
test: ensure cleanup of sqlite3 db files after test
  • Loading branch information
kenjis authored Mar 18, 2024
2 parents c190334 + c85cd6d commit 985ac9f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion tests/system/Database/Live/SQLite3/GetFieldDataTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ protected function createForge(): void
'database' => 'database.db',
'DBDebug' => true,
];
$this->db = db_connect($config);
$this->db = db_connect($config, false);
$this->forge = Database::forge($config);
}

Expand Down
2 changes: 1 addition & 1 deletion tests/system/Database/Live/SQLite3/GetIndexDataTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ protected function setUp(): void
'database' => 'database.db',
'DBDebug' => true,
];
$this->db = db_connect($config);
$this->db = db_connect($config, false);
$this->forge = Database::forge($config);
}

Expand Down
4 changes: 4 additions & 0 deletions tests/system/Database/Migrations/MigrationRunnerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -470,6 +470,10 @@ public function testMigrationUsesSameConnectionAsMigrationRunner(): void
$this->assertCount(2, $tables);
$this->assertSame('migrations', $tables[0]);
$this->assertSame('foo', $tables[1]);

if (is_file($config['database'])) {
unlink($config['database']);
}
}

protected function resetTables($db = null): void
Expand Down

0 comments on commit 985ac9f

Please sign in to comment.