Skip to content

Commit

Permalink
fix: Remove DB files after tests
Browse files Browse the repository at this point in the history
  • Loading branch information
neznaika0 committed Sep 14, 2024
1 parent 904e4f2 commit 4959fb7
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tests/system/Database/Live/ForgeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,11 @@ public function testCreateDatabaseWithDots(): void
$this->assertFalse($result);

$db->close();

if ($this->db->DBDriver !== 'SQLite3') {
$this->forge->dropDatabase($dbName);
} elseif (is_file($db->database)) {
unlink($db->database);
}
}

Expand Down
9 changes: 9 additions & 0 deletions tests/system/Database/Live/SQLite3/GetIndexDataTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,15 @@ protected function setUp(): void
$this->forge = Database::forge($config);
}

protected function tearDown(): void
{
parent::tearDown();

if ($this->db->DBDriver === 'SQLite3' && is_file($this->db->database)) {
unlink($this->db->database);
}
}

public function testGetIndexData(): void
{
// INTEGER PRIMARY KEY AUTO_INCREMENT doesn't get an index by default
Expand Down

0 comments on commit 4959fb7

Please sign in to comment.