Add PHPUnit setup (Phase 0) and pure-logic tests (Phase 1): Crypto, EmailObfuscator, SystemController helpers, StudentEmail, TfeController OG tags

This commit is contained in:
Pontoporeia
2026-05-20 01:28:22 +02:00
parent d9e4541749
commit 7a4d0fafb2
12 changed files with 2811 additions and 14 deletions

17
tests/bootstrap.php Normal file
View File

@@ -0,0 +1,17 @@
<?php
/**
* PHPUnit bootstrap for XAMXAM.
*
* Sets up autoloading, constants, and any environment needed before tests run.
* Uses the production app/.env for APP_KEY (Crypto tests need a real key).
*/
// Composer autoloader
require_once __DIR__ . '/../vendor/autoload.php';
// Define application root (points to app/)
define('APP_ROOT', realpath(__DIR__ . '/../app'));
// Storage directory for tests — use app/storage/
define('STORAGE_ROOT', APP_ROOT . '/storage');