Files
michaelschiemer/tests/debug/test-mock-calls.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

73 lines
2.2 KiB
PHP

<?php
require_once __DIR__ . '/../../vendor/autoload.php';
use App\Framework\LiveComponents\Contracts\ComponentRegistryInterface;
use App\Framework\View\Contracts\HtmlComponentRegistryInterface;
use App\Framework\LiveComponents\Performance\ComponentMetadataCacheInterface;
use App\Framework\Template\Parser\DomTemplateParser;
use App\Framework\View\DomComponentService;
use App\Framework\View\Processors\XComponentProcessor;
use App\Framework\View\RenderContext;
use App\Framework\Meta\MetaData;
// Mock with logging
$liveComponentRegistry = Mockery::mock(ComponentRegistryInterface::class);
$htmlComponentRegistry = Mockery::mock(HtmlComponentRegistryInterface::class);
$metadataCache = Mockery::mock(ComponentMetadataCacheInterface::class);
// Add logging to see what methods are called
$liveComponentRegistry->shouldReceive('isRegistered')
->andReturnUsing(function ($name) {
echo "Mock called: isRegistered('$name')\n";
return $name === 'counter';
});
$liveComponentRegistry->shouldReceive('getClassName')
->andReturnUsing(function ($name) {
echo "Mock called: getClassName('$name')\n";
return 'TestCounter';
});
$liveComponentRegistry->shouldReceive('resolve')
->andReturnUsing(function () {
echo "Mock called: resolve(...)\n";
throw new \Exception("Unexpected call to resolve");
});
$htmlComponentRegistry->shouldReceive('has')
->andReturnUsing(function ($name) {
echo "Mock called: htmlComponentRegistry->has('$name')\n";
return false;
});
$processor = new XComponentProcessor(
$liveComponentRegistry,
$htmlComponentRegistry,
$metadataCache,
new DomComponentService()
);
$html = '<html><body><x-counter id="demo" /></body></html>';
echo "Input: $html\n\n";
$parser = new DomTemplateParser();
$dom = $parser->parseToWrapper($html);
echo "Parsed: " . $dom->document->saveHTML() . "\n\n";
$context = new RenderContext(
template: 'test',
metaData: new MetaData('Test'),
data: []
);
echo "Processing...\n";
try {
$result = $processor->process($dom, $context);
echo "Result: " . $result->document->saveHTML() . "\n";
} catch (\Throwable $e) {
echo "ERROR: " . $e->getMessage() . "\n";
echo $e->getTraceAsString() . "\n";
}