File tree Expand file tree Collapse file tree 2 files changed +22
-4
lines changed Expand file tree Collapse file tree 2 files changed +22
-4
lines changed Original file line number Diff line number Diff line change @@ -41,18 +41,32 @@ final class GetIndexDataTest extends CIUnitTestCase
4141
4242 private Forge $ forge ;
4343
44+ /**
45+ * @var array{DBDriver: string, database: string, DBDebug: bool}
46+ */
47+ private array $ config = [];
48+
4449 protected function setUp (): void
4550 {
4651 parent ::setUp ();
4752
48- $ config = [
53+ $ this -> config = [
4954 'DBDriver ' => 'SQLite3 ' ,
50- 'database ' => 'database.db ' ,
55+ 'database ' => WRITEPATH . 'database.db ' ,
5156 'DBDebug ' => true ,
5257 ];
5358
54- $ this ->db = db_connect ($ config );
55- $ this ->forge = Database::forge ($ config );
59+ $ this ->db = db_connect ($ this ->config );
60+ $ this ->forge = Database::forge ($ this ->config );
61+ }
62+
63+ protected function tearDown (): void
64+ {
65+ parent ::tearDown ();
66+
67+ if (is_file ($ this ->config ['database ' ])) {
68+ unlink ($ this ->config ['database ' ]);
69+ }
5670 }
5771
5872 public function testGetIndexData (): void
Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments