- 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.
80 lines
2.8 KiB
PHP
80 lines
2.8 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
require_once __DIR__ . '/../../vendor/autoload.php';
|
|
|
|
use App\Framework\Mcp\ValueObjects\CodebaseAnalysisResult;
|
|
use App\Framework\Mcp\ValueObjects\CodebaseQuery;
|
|
use App\Framework\Mcp\ValueObjects\RouteInfo;
|
|
|
|
echo "=== CodebaseAnalyzer Value Objects Test ===\n\n";
|
|
|
|
// Test 1: CodebaseQuery Creation
|
|
echo "--- Test 1: CodebaseQuery Factory Methods ---\n";
|
|
$controllersQuery = CodebaseQuery::forControllers();
|
|
echo "✅ Controllers Query: " . json_encode($controllersQuery->toArray(), JSON_PRETTY_PRINT) . "\n\n";
|
|
|
|
$routesQuery = CodebaseQuery::forRoutes();
|
|
echo "✅ Routes Query: attribute_types = " . count($routesQuery->attributeTypes) . "\n\n";
|
|
|
|
$servicesQuery = CodebaseQuery::forServices();
|
|
echo "✅ Services Query: classNamePatterns = " . implode(', ', $servicesQuery->classNamePatterns) . "\n\n";
|
|
|
|
// Test 2: Custom Query
|
|
echo "--- Test 2: Custom CodebaseQuery ---\n";
|
|
$customQuery = CodebaseQuery::fromArray([
|
|
'patterns' => ['UserController', 'ProductService'],
|
|
'attribute_types' => ['App\Framework\Attributes\Route'],
|
|
'max_results' => 50,
|
|
'include_tests' => true,
|
|
]);
|
|
|
|
echo "✅ Custom Query Created:\n";
|
|
echo " - Patterns: " . implode(', ', $customQuery->patterns) . "\n";
|
|
echo " - Max Results: {$customQuery->maxResults}\n";
|
|
echo " - Include Tests: " . ($customQuery->includeTests ? 'Yes' : 'No') . "\n";
|
|
echo " - Has Attribute Search: " . ($customQuery->hasAttributeSearch() ? 'Yes' : 'No') . "\n\n";
|
|
|
|
// Test 3: CodebaseAnalysisResult Creation
|
|
echo "--- Test 3: CodebaseAnalysisResult Construction ---\n";
|
|
$sampleRoutes = [
|
|
new RouteInfo(
|
|
path: '/api/users',
|
|
httpMethod: 'GET',
|
|
controller: 'App\Application\Api\UserController',
|
|
action: 'listUsers'
|
|
),
|
|
new RouteInfo(
|
|
path: '/api/users/{id}',
|
|
httpMethod: 'GET',
|
|
controller: 'App\Application\Api\UserController',
|
|
action: 'getUser',
|
|
parameters: ['id']
|
|
),
|
|
];
|
|
|
|
$result = new CodebaseAnalysisResult(
|
|
routes: $sampleRoutes,
|
|
statistics: [
|
|
'total_routes' => count($sampleRoutes),
|
|
'execution_time_ms' => 42.5,
|
|
],
|
|
executionTimeMs: 42.5
|
|
);
|
|
|
|
echo "✅ Analysis Result Created:\n";
|
|
echo " - Total Components: {$result->getTotalComponents()}\n";
|
|
echo " - Routes Count: " . count($result->routes) . "\n";
|
|
echo " - Is Empty: " . ($result->isEmpty() ? 'Yes' : 'No') . "\n";
|
|
echo " - Execution Time: {$result->executionTimeMs}ms\n\n";
|
|
|
|
// Test 4: Result to Array Conversion
|
|
echo "--- Test 4: Result Serialization ---\n";
|
|
$arrayResult = $result->toArray();
|
|
echo "✅ Array keys: " . implode(', ', array_keys($arrayResult)) . "\n";
|
|
echo " - Routes in array: " . count($arrayResult['routes']) . "\n";
|
|
echo " - First route path: " . $arrayResult['routes'][0]['path'] . "\n\n";
|
|
|
|
echo "=== All Value Object Tests Completed Successfully ✅ ===\n";
|