refactor(compat): Prüfbausteine nach src/Compatibility, Matrix und ManifestCheck generisch
Requirement, Call, ConstantRequirement, Mirror, Problem, FeatureStatus, CompatibilityMatrix, Manifest, ManifestCheck sowie Fingerprints und LineDiff liegen jetzt im divi-freien Kern. Neu: GlobalRequirement, CompatibilityMatrix::fromProblems(), ManifestCheck-Option signatures, DiviManifestCheck::create() und DiviAreas. Divi-Verhalten unverändert. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
9beb55e228
commit
b511ef6348
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace LIT\MCP\Tests\Unit\Integrations\Divi\Release;
|
||||
|
||||
use LIT\MCP\Integrations\Divi\Release\DiviAdapters;
|
||||
use LIT\MCP\Integrations\Divi\Release\DiviManifestCheck;
|
||||
use LIT\MCP\Tests\Unit\TestCase;
|
||||
|
||||
final class DiviManifestCheckTest extends TestCase
|
||||
{
|
||||
public function testCreateChecksEveryDiviManifest(): void
|
||||
{
|
||||
$code = [];
|
||||
$mirrors = [];
|
||||
foreach (DiviAdapters::manifests() as $manifest) {
|
||||
foreach ([...$manifest->calls, ...$manifest->constants] as $requirement) {
|
||||
$code[] = $manifest->area . ': ' . $requirement->label();
|
||||
}
|
||||
$mirrors = [...$mirrors, ...array_map(static fn ($mirror): string => $mirror->id, $manifest->mirrors)];
|
||||
}
|
||||
$check = DiviManifestCheck::create();
|
||||
|
||||
self::assertNotSame([], $code);
|
||||
self::assertSame(array_values(array_unique($code)), array_keys($check->codeChecks()));
|
||||
self::assertCount(count(array_unique($mirrors)), $check->mirrorChecks());
|
||||
self::assertNotSame([], $check->registrationChecks(), 'DiviModules::knowsBlock is wired for block types');
|
||||
}
|
||||
|
||||
public function testCreateLoadsTheSignatureReferences(): void
|
||||
{
|
||||
$kinds = array_map(static fn ($problem): string => $problem->kind, DiviManifestCheck::create()->codeProblems());
|
||||
|
||||
self::assertNotContains('reference-missing', $kinds);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user