Skip to content

Commit c85cd6d

Browse files
committed
test: ensure cleanup of sqlite3 db files after test
1 parent e6052cf commit c85cd6d

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

tests/system/Database/Live/SQLite3/GetFieldDataTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ protected function createForge(): void
3232
'database' => 'database.db',
3333
'DBDebug' => true,
3434
];
35-
$this->db = db_connect($config);
35+
$this->db = db_connect($config, false);
3636
$this->forge = Database::forge($config);
3737
}
3838

tests/system/Database/Live/SQLite3/GetIndexDataTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ protected function setUp(): void
4545
'database' => 'database.db',
4646
'DBDebug' => true,
4747
];
48-
$this->db = db_connect($config);
48+
$this->db = db_connect($config, false);
4949
$this->forge = Database::forge($config);
5050
}
5151

tests/system/Database/Migrations/MigrationRunnerTest.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -470,6 +470,10 @@ public function testMigrationUsesSameConnectionAsMigrationRunner(): void
470470
$this->assertCount(2, $tables);
471471
$this->assertSame('migrations', $tables[0]);
472472
$this->assertSame('foo', $tables[1]);
473+
474+
if (is_file($config['database'])) {
475+
unlink($config['database']);
476+
}
473477
}
474478

475479
protected function resetTables($db = null): void

0 commit comments

Comments
 (0)