packages() as $manifest) { foreach (array_keys($manifest->components()) as $component) { $declared[] = $manifest->name . ':' . $component; } } $planned = []; foreach ($levels as $package => $components) { foreach (array_keys($components) as $component) { $planned[] = $package . ':' . $component; } } sort($declared); sort($planned); eq($declared, $planned, 'cada componente del catalogo tiene su nivel de evidencia planeado'); }); Harness::it('los stamps tested estan respaldados por el reporte del barrido', function () { $repo = $GLOBALS['g11_repo']; $reportPath = $repo . '/tests/compat/report.json'; if (!is_file($reportPath)) { return; // offline sin barrido previo: no se inventa evidencia ni se exige. } $report = json_decode((string) file_get_contents($reportPath), true); ok(is_array($report) && isset($report['components']), 'report.json valido'); $levels = json_decode((string) file_get_contents($repo . '/tests/compat/levels.json'), true); $catalog = Catalog::fromRoot($repo); foreach ($catalog->packages() as $manifest) { foreach (array_keys($manifest->components()) as $component) { $id = $manifest->name . ':' . $component; $level = $levels[$manifest->name][$component] ?? null; $level = is_array($level) ? $level['level'] : $level; $status = $report['components'][$id]['status'] ?? 'missing'; $tested = $manifest->testedCore($component); $independ = $manifest->coreIndependent($component); if ($level === 'none') { ok($independ, "$id esta sin evidencia de barrido y debe declarar core none"); } if ($independ) { eq('none', $level, "$id se declara independiente y su nivel debe ser none"); eq(null, $tested, "$id independiente no puede declarar tested"); continue; } if ($tested !== null) { eq('ok', $status, "$id declara tested='$tested' pero su evidencia en el reporte es '$status'"); } } } });