recreate project

This commit is contained in:
root
2026-02-10 22:11:06 -05:00
commit 663c0cdbda
10149 changed files with 1379710 additions and 0 deletions
+28
View File
@@ -0,0 +1,28 @@
<?php
namespace Tests\Support;
use CodeIgniter\Test\CIUnitTestCase;
use Config\Database;
class DBReset
{
protected static array $excludeTables = ['migrations'];
public static function resetDatabase(): void
{
$db = Database::connect();
$db->disableForeignKeyChecks();
// Get all table names
$tables = $db->listTables();
foreach ($tables as $table) {
if (!in_array($table, self::$excludeTables)) {
$db->table($table)->truncate();
}
}
$db->enableForeignKeyChecks();
}
}