Skip to content

Commit 4de1831

Browse files
committed
test: fix failed test
1) CodeIgniter\Commands\CreateDatabaseTest::testCreateDatabase Failed asserting that 'Database ".../CodeIgniter4/writable/foobar.db" already exists.\n \n ' contains "successfully created.". .../CodeIgniter4/tests/system/Commands/CreateDatabaseTest.php:68
1 parent 6953587 commit 4de1831

1 file changed

Lines changed: 5 additions & 10 deletions

File tree

tests/system/Commands/CreateDatabaseTest.php

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -38,22 +38,17 @@ protected function setUp(): void
3838
$this->connection = Database::connect();
3939

4040
parent::setUp();
41+
42+
$file = WRITEPATH . 'foobar.db';
43+
if (file_exists($file)) {
44+
unlink($file);
45+
}
4146
}
4247

4348
protected function tearDown(): void
4449
{
4550
stream_filter_remove($this->streamFilter);
4651

47-
if ($this->connection instanceof Connection) {
48-
$file = WRITEPATH . 'foobar.db';
49-
50-
if (file_exists($file)) {
51-
unlink($file);
52-
}
53-
} else {
54-
Database::forge()->dropDatabase('foobar');
55-
}
56-
5752
parent::tearDown();
5853
}
5954

0 commit comments

Comments
 (0)