Merge pull request #8393 from paulbalandan/leftover-db-files

test: ensure cleanup of sqlite3 db files after test
This commit is contained in:
kenjis 2024-03-18 10:35:01 +09:00 committed by GitHub
commit 985ac9f039
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 6 additions and 2 deletions

View File

@ -32,7 +32,7 @@ final class GetFieldDataTest extends AbstractGetFieldDataTest
'database' => 'database.db',
'DBDebug' => true,
];
$this->db = db_connect($config);
$this->db = db_connect($config, false);
$this->forge = Database::forge($config);
}

View File

@ -45,7 +45,7 @@ final class GetIndexDataTest extends CIUnitTestCase
'database' => 'database.db',
'DBDebug' => true,
];
$this->db = db_connect($config);
$this->db = db_connect($config, false);
$this->forge = Database::forge($config);
}

View File

@ -470,6 +470,10 @@ final class MigrationRunnerTest extends CIUnitTestCase
$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