Skip to content

Commit a9c3ae2

Browse files
chore: Don't reset database in InitializerHelper
This should already be done in tests/bootstrap.php, and it's totally useless to execute this before each test classes. Also, it's extremely time-consuming.
1 parent cd0c2f6 commit a9c3ae2

File tree

1 file changed

+0
-20
lines changed

1 file changed

+0
-20
lines changed

src/Tests/InitializerHelper.php

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -16,26 +16,6 @@
1616
*/
1717
trait InitializerHelper
1818
{
19-
#[\PHPUnit\Framework\Attributes\BeforeClass]
20-
public static function initDatabase(): void
21-
{
22-
if (!\Minz\Configuration::$database) {
23-
return;
24-
}
25-
26-
$schema_path = \Minz\Configuration::$schema_path;
27-
$schema = @file_get_contents($schema_path);
28-
29-
if ($schema === false) {
30-
throw new Errors\RuntimeException("SQL schema under {$schema_path} cannot be read.");
31-
}
32-
33-
\Minz\Database::reset();
34-
35-
$database = \Minz\Database::get();
36-
$database->exec($schema);
37-
}
38-
3919
#[\PHPUnit\Framework\Attributes\Before]
4020
public function beginDatabaseTransaction(): void
4121
{

0 commit comments

Comments
 (0)