Files
michaelschiemer/tests/debug/test-refactored-components.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

154 lines
4.7 KiB
PHP

#!/usr/bin/env php
<?php
declare(strict_types=1);
require __DIR__ . '/../../vendor/autoload.php';
use App\Application\LiveComponents\ActivityFeedComponent;
use App\Application\LiveComponents\AutocompleteComponent;
use App\Application\LiveComponents\ChartComponent;
use App\Application\LiveComponents\InfiniteScrollComponent;
use App\Application\LiveComponents\MetricsDashboardComponent;
use App\Application\LiveComponents\Services\DemoActivityDataProvider;
use App\Application\LiveComponents\Services\DemoMetricsDataProvider;
use App\Application\LiveComponents\Services\DemoScrollDataProvider;
use App\Application\LiveComponents\Services\DemoSuggestionProvider;
echo "Testing Refactored LiveComponents\n";
echo "==================================\n\n";
// Test 1: ChartComponent
echo "1. Testing ChartComponent...\n";
try {
$chart = new ChartComponent(
id: 'chart-test',
initialData: [
'data_source' => 'demo',
'chart_type' => 'line',
'data_range' => '24h',
]
);
echo " ✓ ChartComponent created successfully\n";
echo " - ID: " . $chart->getId() . "\n";
// Test action method
$result = $chart->refreshData();
echo " ✓ refreshData() returns array: " . (is_array($result) ? 'YES' : 'NO') . "\n";
echo " - Keys: " . implode(', ', array_keys($result)) . "\n";
} catch (\Throwable $e) {
echo " ✗ Error: " . $e->getMessage() . "\n";
echo " File: " . $e->getFile() . ":" . $e->getLine() . "\n";
}
echo "\n";
// Test 2: AutocompleteComponent
echo "2. Testing AutocompleteComponent...\n";
try {
$provider = new DemoSuggestionProvider();
$autocomplete = new AutocompleteComponent(
id: 'autocomplete-test',
suggestionProvider: $provider,
initialData: ['context' => 'general']
);
echo " ✓ AutocompleteComponent created successfully\n";
echo " - ID: " . $autocomplete->getId() . "\n";
// Test action method
$result = $autocomplete->getSuggestions('test', 'general');
echo " ✓ getSuggestions() returns array: " . (is_array($result) ? 'YES' : 'NO') . "\n";
echo " - Keys: " . implode(', ', array_keys($result)) . "\n";
} catch (\Throwable $e) {
echo " ✗ Error: " . $e->getMessage() . "\n";
echo " File: " . $e->getFile() . ":" . $e->getLine() . "\n";
}
echo "\n";
// Test 3: InfiniteScrollComponent
echo "3. Testing InfiniteScrollComponent...\n";
try {
$provider = new DemoScrollDataProvider();
$scroll = new InfiniteScrollComponent(
id: 'scroll-test',
dataProvider: $provider,
initialData: ['page_size' => 20]
);
echo " ✓ InfiniteScrollComponent created successfully\n";
echo " - ID: " . $scroll->getId() . "\n";
// Test action method
$result = $scroll->loadMore();
echo " ✓ loadMore() returns array: " . (is_array($result) ? 'YES' : 'NO') . "\n";
echo " - Keys: " . implode(', ', array_keys($result)) . "\n";
} catch (\Throwable $e) {
echo " ✗ Error: " . $e->getMessage() . "\n";
echo " File: " . $e->getFile() . ":" . $e->getLine() . "\n";
}
echo "\n";
// Test 4: ActivityFeedComponent
echo "4. Testing ActivityFeedComponent...\n";
try {
$provider = new DemoActivityDataProvider();
$activity = new ActivityFeedComponent(
id: 'activity-test',
dataProvider: $provider,
initialData: ['filter' => 'all']
);
echo " ✓ ActivityFeedComponent created successfully\n";
echo " - ID: " . $activity->getId() . "\n";
// Test action method
$result = $activity->setFilter('comments');
echo " ✓ setFilter() returns array: " . (is_array($result) ? 'YES' : 'NO') . "\n";
echo " - Keys: " . implode(', ', array_keys($result)) . "\n";
} catch (\Throwable $e) {
echo " ✗ Error: " . $e->getMessage() . "\n";
echo " File: " . $e->getFile() . ":" . $e->getLine() . "\n";
}
echo "\n";
// Test 5: MetricsDashboardComponent
echo "5. Testing MetricsDashboardComponent...\n";
try {
$provider = new DemoMetricsDataProvider();
$metrics = new MetricsDashboardComponent(
id: 'metrics-test',
dataProvider: $provider,
initialData: ['time_range' => '30d']
);
echo " ✓ MetricsDashboardComponent created successfully\n";
echo " - ID: " . $metrics->getId() . "\n";
// Test action method
$result = $metrics->refreshMetrics();
echo " ✓ refreshMetrics() returns array: " . (is_array($result) ? 'YES' : 'NO') . "\n";
echo " - Keys: " . implode(', ', array_keys($result)) . "\n";
} catch (\Throwable $e) {
echo " ✗ Error: " . $e->getMessage() . "\n";
echo " File: " . $e->getFile() . ":" . $e->getLine() . "\n";
}
echo "\n";
echo "==================================\n";
echo "All component tests completed!\n";