fix: DockerSecretsResolver - don't normalize absolute paths like /var/www/html/...
Some checks failed
Deploy Application / deploy (push) Has been cancelled
Some checks failed
Deploy Application / deploy (push) Has been cancelled
This commit is contained in:
83
tests/debug/test-component-discovery.php
Normal file
83
tests/debug/test-component-discovery.php
Normal file
@@ -0,0 +1,83 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
require_once __DIR__ . '/../../vendor/autoload.php';
|
||||
|
||||
use App\Framework\Core\PathProvider;
|
||||
use App\Framework\Discovery\UnifiedDiscoveryService;
|
||||
use App\Framework\Discovery\ValueObjects\DiscoveryOptions;
|
||||
use App\Framework\Discovery\ValueObjects\ScanType;
|
||||
use App\Framework\Cache\Driver\NullCache;
|
||||
use App\Framework\Cache\GeneralCache;
|
||||
use App\Framework\Serializer\Php\PhpSerializer;
|
||||
use App\Framework\Cache\Compression\NullCompression;
|
||||
use App\Framework\DateTime\SystemClock;
|
||||
use App\Framework\ReflectionLegacy\CachedReflectionProvider;
|
||||
use App\Framework\Discovery\ValueObjects\DiscoveryConfiguration;
|
||||
|
||||
echo "\n=== Testing Component Discovery ===\n\n";
|
||||
|
||||
$pathProvider = new PathProvider('/var/www/html');
|
||||
$nullCache = new GeneralCache(new NullCache(), new PhpSerializer(), new NullCompression());
|
||||
$clock = new SystemClock();
|
||||
$reflectionProvider = new CachedReflectionProvider();
|
||||
$config = DiscoveryConfiguration::development();
|
||||
|
||||
$discoveryService = new UnifiedDiscoveryService(
|
||||
pathProvider: $pathProvider,
|
||||
cache: $nullCache, // Use null cache to force fresh discovery
|
||||
clock: $clock,
|
||||
reflectionProvider: $reflectionProvider,
|
||||
configuration: $config
|
||||
);
|
||||
|
||||
$options = DiscoveryOptions::default()
|
||||
->withPaths([$pathProvider->getSourcePath()->toString()])
|
||||
->withScanType(ScanType::FULL);
|
||||
$options = new DiscoveryOptions(
|
||||
paths: [$pathProvider->getSourcePath()->toString()],
|
||||
scanType: ScanType::FULL,
|
||||
useCache: false // Explicitly disable cache
|
||||
);
|
||||
|
||||
echo "Starting discovery without cache...\n";
|
||||
$registry = $discoveryService->discoverWithOptions($options);
|
||||
|
||||
echo "\nDiscovery completed.\n";
|
||||
echo "Total files processed: " . $registry->getFileCount() . "\n";
|
||||
|
||||
$components = $registry->attributes()->get('App\Framework\View\Attributes\ComponentName');
|
||||
echo "Total ComponentName attributes found: " . count($components) . "\n\n";
|
||||
|
||||
$found = [];
|
||||
foreach ($components as $c) {
|
||||
$attr = $c->createAttributeInstance();
|
||||
if ($attr) {
|
||||
$found[] = [
|
||||
'class' => $c->className->toString(),
|
||||
'tag' => $attr->tag
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
echo "All ComponentName attributes:\n";
|
||||
foreach ($found as $item) {
|
||||
echo " - {$item['class']} -> {$item['tag']}\n";
|
||||
}
|
||||
|
||||
echo "\nSearch/Popover components:\n";
|
||||
$searchPopover = array_filter($found, function($item) {
|
||||
return str_contains($item['class'], 'Search') || str_contains($item['class'], 'Popover');
|
||||
});
|
||||
|
||||
if (empty($searchPopover)) {
|
||||
echo " ❌ NOT FOUND\n";
|
||||
} else {
|
||||
foreach ($searchPopover as $item) {
|
||||
echo " ✓ {$item['class']} -> {$item['tag']}\n";
|
||||
}
|
||||
}
|
||||
|
||||
echo "\n";
|
||||
|
||||
Reference in New Issue
Block a user