Files
michaelschiemer/tests/debug/test-template-processor-simple.php
Michael Schiemer fc3d7e6357 feat(Production): Complete production deployment infrastructure
- Add comprehensive health check system with multiple endpoints
- Add Prometheus metrics endpoint
- Add production logging configurations (5 strategies)
- Add complete deployment documentation suite:
  * QUICKSTART.md - 30-minute deployment guide
  * DEPLOYMENT_CHECKLIST.md - Printable verification checklist
  * DEPLOYMENT_WORKFLOW.md - Complete deployment lifecycle
  * PRODUCTION_DEPLOYMENT.md - Comprehensive technical reference
  * production-logging.md - Logging configuration guide
  * ANSIBLE_DEPLOYMENT.md - Infrastructure as Code automation
  * README.md - Navigation hub
  * DEPLOYMENT_SUMMARY.md - Executive summary
- Add deployment scripts and automation
- Add DEPLOYMENT_PLAN.md - Concrete plan for immediate deployment
- Update README with production-ready features

All production infrastructure is now complete and ready for deployment.
2025-10-25 19:18:37 +02:00

80 lines
2.4 KiB
PHP

<?php
require_once __DIR__ . '/../../vendor/autoload.php';
use App\Framework\View\TemplateProcessor;
use App\Framework\View\RenderContext;
use App\Framework\View\ProcessingMode;
use App\Framework\Meta\MetaData;
use App\Framework\View\Dom\Transformer\XComponentTransformer;
use App\Framework\View\Processors\PlaceholderReplacer;
use App\Framework\View\Processors\ForStringProcessor;
use App\Framework\DI\DefaultContainer;
echo "=== TemplateProcessor AST Integration Test (Simple) ===\n\n";
// Create minimal container
$container = new DefaultContainer();
// Create TemplateProcessor WITHOUT any processors (minimal test)
$templateProcessor = new TemplateProcessor(
astTransformers: [], // No transformers for this simple test
stringProcessors: [], // No string processors
container: $container
);
// Test HTML - just plain HTML without any special processing
$html = <<<HTML
<html>
<head>
<title>Test Page</title>
</head>
<body>
<h1>Hello World</h1>
<p>This is a simple test.</p>
</body>
</html>
HTML;
echo "Input HTML:\n$html\n\n";
// Create minimal RenderContext
$context = new RenderContext(
template: 'test-simple',
metaData: new MetaData('Simple Test'),
data: [],
processingMode: ProcessingMode::MINIMAL // Minimal processing
);
try {
// Render (should just parse and return the HTML unchanged)
$output = $templateProcessor->render($context, $html);
echo "Output HTML:\n$output\n\n";
// Verify basic structure is preserved
$checks = [
'title preserved' => str_contains($output, '<title>Test Page</title>'),
'h1 preserved' => str_contains($output, '<h1>Hello World</h1>'),
'paragraph preserved' => str_contains($output, '<p>This is a simple test.</p>'),
'html structure' => str_contains($output, '<html>') && str_contains($output, '</html>'),
'body structure' => str_contains($output, '<body>') && str_contains($output, '</body>')
];
echo "Verification:\n";
foreach ($checks as $check => $passed) {
echo ($passed ? '✓' : '✗') . " $check\n";
}
$allPassed = array_reduce($checks, fn($carry, $item) => $carry && $item, true);
echo "\n" . ($allPassed ? '✅ TEMPLATE PROCESSOR AST INTEGRATION WORKING!' : '❌ SOME CHECKS FAILED') . "\n";
exit($allPassed ? 0 : 1);
} catch (\Throwable $e) {
echo "❌ ERROR: {$e->getMessage()}\n";
echo "Stack trace:\n{$e->getTraceAsString()}\n";
exit(1);
}