Fix LESS import error and refactor project structure

This commit is contained in:
kirill.khorkov
2026-01-03 18:59:56 +03:00
parent 1bb0fc02e6
commit 4a8d4f8c3f
201 changed files with 891 additions and 14311 deletions

View File

@@ -0,0 +1,70 @@
<?php
echo "Проверка модели User:\n";
$userModelPath = __DIR__ . '/../app/Models/User.php';
$test->assert(file_exists($userModelPath), "Файл модели User существует");
$userModelContent = file_get_contents($userModelPath);
$test->assertContains(
"'is_admin' => \$isAdmin ? 'true' : 'false'",
$userModelContent,
"is_admin преобразуется в строку для PostgreSQL"
);
$test->assertContains(
"'is_active' => 'true'",
$userModelContent,
"is_active преобразуется в строку для PostgreSQL"
);
$test->assertContains(
"public function register(array \$data)",
$userModelContent,
"Метод register существует в модели User"
);
$test->assertContains(
"public function authenticate(string \$email, string \$password)",
$userModelContent,
"Метод authenticate существует в модели User"
);
$test->assertContains(
"public function hashPassword(string \$password)",
$userModelContent,
"Метод hashPassword существует в модели User"
);
echo "\nПроверка register_handler.php:\n";
$registerHandlerPath = __DIR__ . '/../register_handler.php';
$test->assert(file_exists($registerHandlerPath), "Файл register_handler.php существует");
$registerHandlerContent = file_get_contents($registerHandlerPath);
$test->assertContains(
"filter_var(\$email, FILTER_VALIDATE_EMAIL)",
$registerHandlerContent,
"Валидация email присутствует"
);
$test->assertContains(
"strlen(\$password) < 6",
$registerHandlerContent,
"Проверка минимальной длины пароля присутствует"
);
$test->assertContains(
"\$password !== \$confirm_password",
$registerHandlerContent,
"Проверка совпадения паролей присутствует"
);
$hasBooleanConversion = str_contains($registerHandlerContent, "\$is_admin ? 'true' : 'false'")
|| str_contains($registerHandlerContent, "\$is_admin ? 1 : 0");
$test->assert(
$hasBooleanConversion,
"is_admin преобразуется для PostgreSQL в register_handler"
);