Skip to content

Commit

Permalink
test: ensure cleanup of sqlite3 db files after test
Browse files Browse the repository at this point in the history
  • Loading branch information
paulbalandan committed Mar 10, 2024
1 parent e6052cf commit c85cd6d
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 c85cd6d

Please sign in to comment.