From a9c3ae219921fc5218b64fd9dcb8c7fb714f2618 Mon Sep 17 00:00:00 2001 From: Marien Fressinaud Date: Tue, 25 Nov 2025 17:55:16 +0100 Subject: [PATCH] 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. --- src/Tests/InitializerHelper.php | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/src/Tests/InitializerHelper.php b/src/Tests/InitializerHelper.php index 1d1b62c..22f9b04 100644 --- a/src/Tests/InitializerHelper.php +++ b/src/Tests/InitializerHelper.php @@ -16,26 +16,6 @@ */ trait InitializerHelper { - #[\PHPUnit\Framework\Attributes\BeforeClass] - public static function initDatabase(): void - { - if (!\Minz\Configuration::$database) { - return; - } - - $schema_path = \Minz\Configuration::$schema_path; - $schema = @file_get_contents($schema_path); - - if ($schema === false) { - throw new Errors\RuntimeException("SQL schema under {$schema_path} cannot be read."); - } - - \Minz\Database::reset(); - - $database = \Minz\Database::get(); - $database->exec($schema); - } - #[\PHPUnit\Framework\Attributes\Before] public function beginDatabaseTransaction(): void {