- 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.
73 lines
3.0 KiB
PHP
73 lines
3.0 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
use App\Framework\Mcp\Tools\FrameworkTools;
|
|
|
|
describe('FrameworkTools', function () {
|
|
// Lazy initialization - only bootstrap when needed, reuse across all tests
|
|
$frameworkTools = null;
|
|
|
|
$getFrameworkTools = function () use (&$frameworkTools) {
|
|
if ($frameworkTools === null) {
|
|
$container = createTestContainer();
|
|
$discoveryService = $container->get(\App\Framework\Discovery\UnifiedDiscoveryService::class);
|
|
$compiledRoutes = $container->get(\App\Framework\Router\CompiledRoutes::class);
|
|
$discoveryRegistry = $discoveryService->getResults();
|
|
|
|
$frameworkTools = new FrameworkTools(
|
|
$container,
|
|
$discoveryService,
|
|
$compiledRoutes,
|
|
$discoveryRegistry
|
|
);
|
|
}
|
|
|
|
return $frameworkTools;
|
|
};
|
|
|
|
describe('analyze_routes', function () use ($getFrameworkTools) {
|
|
it('returns route analysis with compiled and discovered routes', function () use ($getFrameworkTools) {
|
|
$tools = $getFrameworkTools();
|
|
$result = $tools->analyzeRoutes();
|
|
|
|
expect($result)->toHaveKeys(['compiled_routes', 'discovered_routes', 'summary']);
|
|
expect($result['compiled_routes'])->toHaveKeys(['named_routes', 'static_routes', 'total']);
|
|
expect($result['discovered_routes'])->toHaveKeys(['routes', 'total']);
|
|
expect($result['summary'])->toHaveKeys(['compiled_total', 'discovered_total', 'context']);
|
|
});
|
|
});
|
|
|
|
describe('analyze_container_bindings', function () use ($getFrameworkTools) {
|
|
it('returns comprehensive container analysis', function () use ($getFrameworkTools) {
|
|
$tools = $getFrameworkTools();
|
|
$result = $tools->analyzeContainerBindings();
|
|
|
|
expect($result)->toHaveKeys(['summary', 'bindings', 'singletons', 'instances', 'issues', 'recommendations']);
|
|
expect($result['summary'])->toHaveKeys(['bindings', 'singletons_marked', 'instances', 'issues']);
|
|
});
|
|
});
|
|
|
|
describe('framework_health_check', function () use ($getFrameworkTools) {
|
|
it('performs health check of framework components', function () use ($getFrameworkTools) {
|
|
$tools = $getFrameworkTools();
|
|
$result = $tools->frameworkHealthCheck();
|
|
|
|
expect($result)->toHaveKeys(['status', 'components', 'timestamp']);
|
|
expect($result['status'])->toBe('completed');
|
|
expect($result['components'])->toHaveKeys(['container', 'routes', 'discovery_service']);
|
|
});
|
|
});
|
|
|
|
describe('list_framework_modules', function () use ($getFrameworkTools) {
|
|
it('lists all framework modules with file counts', function () use ($getFrameworkTools) {
|
|
$tools = $getFrameworkTools();
|
|
$result = $tools->listFrameworkModules();
|
|
|
|
expect($result)->toHaveKeys(['modules', 'total_modules']);
|
|
expect($result['modules'])->toBeArray();
|
|
expect($result['total_modules'])->toBeInt();
|
|
});
|
|
});
|
|
});
|