=')) { echo "โœ… PHPUnit 12+ confirmed" . PHP_EOL; } else { echo "โŒ PHPUnit version too old" . PHP_EOL; } } else { echo "โŒ PHPUnit\Runner\Version class not found" . PHP_EOL; } } else { echo "โŒ Vendor autoload not found - run 'composer install'" . PHP_EOL; } echo PHP_EOL . "๐Ÿงช Testing Framework Configuration..." . PHP_EOL; // Check configuration files $configFiles = [ '../phpunit.xml' => 'PHPUnit Configuration', 'bootstrap.php' => 'Test Bootstrap' ]; foreach ($configFiles as $file => $description) { $fullPath = __DIR__ . '/' . $file; if (file_exists($fullPath)) { echo "โœ… $description found" . PHP_EOL; // Check schema version in phpunit.xml if ($file === '../phpunit.xml') { $content = file_get_contents($fullPath); if (strpos($content, '12.3/phpunit.xsd') !== false) { echo "โœ… Schema version 12.3 confirmed" . PHP_EOL; } else { echo "โš ๏ธ Schema version might need updating" . PHP_EOL; } } } else { echo "โŒ $description missing: $fullPath" . PHP_EOL; } } echo PHP_EOL . "๐Ÿ” Checking Test Files..." . PHP_EOL; $testFiles = glob(__DIR__ . '/*Test.php'); $validTests = 0; $totalTests = count($testFiles); foreach ($testFiles as $testFile) { $fileName = basename($testFile); // Check syntax $output = []; $returnVar = 0; exec("php -l \"$testFile\" 2>&1", $output, $returnVar); if ($returnVar === 0) { echo "โœ… $fileName - syntax OK" . PHP_EOL; $validTests++; // Check for namespace $content = file_get_contents($testFile); if (strpos($content, 'namespace DeskMoloni\\Tests;') !== false) { echo " โœ… PSR-4 namespace found" . PHP_EOL; } else { echo " โš ๏ธ PSR-4 namespace missing" . PHP_EOL; } if (strpos($content, 'declare(strict_types=1);') !== false) { echo " โœ… Strict types enabled" . PHP_EOL; } else { echo " โš ๏ธ Strict types not enabled" . PHP_EOL; } } else { echo "โŒ $fileName - syntax errors" . PHP_EOL; echo " " . implode("\n ", $output) . PHP_EOL; } } echo PHP_EOL . "๐Ÿ“‹ Validation Summary" . PHP_EOL; echo "===================" . PHP_EOL; echo "Test Files: $validTests/$totalTests valid" . PHP_EOL; // Check required PHP extensions for PHPUnit 12 echo PHP_EOL . "๐Ÿ”ง PHP Extensions Check..." . PHP_EOL; $requiredExtensions = ['dom', 'json', 'libxml', 'mbstring', 'tokenizer', 'xml', 'xmlwriter']; $missingExtensions = []; foreach ($requiredExtensions as $ext) { if (extension_loaded($ext)) { echo "โœ… $ext extension loaded" . PHP_EOL; } else { echo "โŒ $ext extension MISSING" . PHP_EOL; $missingExtensions[] = $ext; } } if (empty($missingExtensions)) { echo PHP_EOL . "๐ŸŽ‰ All checks passed! PHPUnit 12.3 upgrade is complete and ready." . PHP_EOL; echo "You can run tests with: vendor/bin/phpunit" . PHP_EOL; } else { echo PHP_EOL . "โš ๏ธ Upgrade complete but missing extensions prevent execution." . PHP_EOL; echo "Install missing extensions: " . implode(', ', $missingExtensions) . PHP_EOL; echo "Command: sudo apt-get install php8.3-" . implode(' php8.3-', $missingExtensions) . PHP_EOL; } echo PHP_EOL . "=== Validation Complete ===" . PHP_EOL;