Skip to content

Commit 4959fb7

Browse files
committed
fix: Remove DB files after tests
1 parent 904e4f2 commit 4959fb7

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

tests/system/Database/Live/ForgeTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,11 @@ public function testCreateDatabaseWithDots(): void
8181
$this->assertFalse($result);
8282

8383
$db->close();
84+
8485
if ($this->db->DBDriver !== 'SQLite3') {
8586
$this->forge->dropDatabase($dbName);
87+
} elseif (is_file($db->database)) {
88+
unlink($db->database);
8689
}
8790
}
8891

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,15 @@ protected function setUp(): void
5151
$this->forge = Database::forge($config);
5252
}
5353

54+
protected function tearDown(): void
55+
{
56+
parent::tearDown();
57+
58+
if ($this->db->DBDriver === 'SQLite3' && is_file($this->db->database)) {
59+
unlink($this->db->database);
60+
}
61+
}
62+
5463
public function testGetIndexData(): void
5564
{
5665
// INTEGER PRIMARY KEY AUTO_INCREMENT doesn't get an index by default

0 commit comments

Comments
 (0)