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>
38 lines
1.4 KiB
PHP
38 lines
1.4 KiB
PHP
<?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);
|
|
}
|
|
}
|