#!/usr/bin/env php 'Fixtures', 'path' => __DIR__ . '/../../database/fixtures/CreateTestDatabase.php'], ['name' => 'Integration', 'path' => __DIR__ . '/tests/Integration/SearchTest.php'], ['name' => 'Security', 'path' => __DIR__ . '/tests/Security/SecurityTest.php'], ['name' => 'Unit', 'path' => __DIR__ . '/tests/Unit/RateLimitTest.php'], ]; $totalTests = 0; $passedTests = 0; $failedTests = 0; foreach ($testFiles as $test) { echo "┌─────────────────────────────────────────┐\n"; echo "│ Test Suite: " . str_pad($test['name'], 27) . "│\n"; echo "└─────────────────────────────────────────┘\n\n"; $totalTests++; $path = $test['path']; $file = basename($path); if (!file_exists($path)) { echo "⚠️ SKIP: $file (not found at $path)\n\n"; continue; } echo "Running: $file\n"; echo str_repeat("─", 50) . "\n"; ob_start(); $exitCode = 0; try { include $path; } catch (Exception $e) { echo "❌ ERROR: " . $e->getMessage() . "\n"; $exitCode = 1; } $output = ob_get_clean(); if ($exitCode === 0 && ( strpos($output, '❌') !== false || strpos($output, 'FAIL') !== false || strpos($output, 'Error:') !== false )) { $exitCode = 1; } echo $output; if ($exitCode === 0) { echo "\n✅ PASSED\n\n"; $passedTests++; } else { echo "\n❌ FAILED\n\n"; $failedTests++; } } echo "╔════════════════════════════════════════════╗\n"; echo "║ Test Summary ║\n"; echo "╠════════════════════════════════════════════╣\n"; echo "║ Total: " . str_pad($totalTests, 35) . "║\n"; echo "║ Passed: " . str_pad($passedTests . " ✅", 36) . "║\n"; echo "║ Failed: " . str_pad($failedTests . ($failedTests > 0 ? " ❌" : ""), 36) . "║\n"; echo "╚════════════════════════════════════════════╝\n\n"; if ($failedTests > 0) { echo "❌ Some tests failed!\n"; exit(1); } else { echo "✅ All tests passed!\n"; exit(0); }