Files
dh 9834cc0eb7
Tests / test (push) Successful in 46s
Standardisiere Symcon-Modultests
2026-09-17 12:36:41 +00:00

34 lines
850 B
PHP

<?php
declare(strict_types=1);
$manifest = require dirname(__DIR__) . '/manifest.php';
$paths = array_slice($argv, 1);
$shared = [
'library.json',
'composer.json',
'tests/Symcon/TestContext.php',
'tests/Symcon/TestRunner.php',
'tests/Symcon/bootstrap.php',
'tests/Symcon/manifest.php',
];
$selected = [];
foreach ($paths as $path) {
$path = ltrim(str_replace('\\', '/', $path), './');
if (in_array($path, $shared, true)) {
$selected = array_keys($manifest);
break;
}
foreach ($manifest as $name => $definition) {
foreach ($definition['paths'] as $pattern) {
if (fnmatch($pattern, $path)) {
$selected[] = $name;
break;
}
}
}
}
echo json_encode(array_values(array_unique($selected)), JSON_THROW_ON_ERROR) . PHP_EOL;