feat(compat): Profile, Gates und Pods über den Kompatibilitätskern
Neu: Tier, Profile, Compatibility, CapabilityLocked, CapabilityGate, CompatibilityComponent, ProvidesCompatibility, DiviProfile sowie PodsFeature, PodsCompatibility und PodsIntegration. Das CapabilityGate sperrt gesperrte und unbekannte Fähigkeits-IDs (übernimmt die Sperre unbekannter IDs vom DiviFeatureGate) und delegiert nur Divi ausdrücklich. Pods-Schema, -Lesen, -Schreiben und -Feldrechte laufen über usable(PodsFeature::…); Schreiben verlangt FieldRead und FieldWrite, damit ein Rollback keine Werte verliert. lit-site-status meldet Pods über die CompatibilityComponent. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
b511ef6348
commit
c85131603b
@@ -265,18 +265,18 @@ final class DiviFeatureGateTest extends TestCase
|
||||
);
|
||||
}
|
||||
|
||||
public function testAnUnknownRequirementOfTheCoreLocksTheToolAndIsLogged(): void
|
||||
/** The lock of IDs that are no Divi capability is CapabilityGate's (unknown ones fail closed there). */
|
||||
public function testIdsThatAreNoDiviCapabilityAreIgnored(): void
|
||||
{
|
||||
$log = new FakeChangeLog();
|
||||
$tool = $this->contentCreate($this->composerNeeding('page-write', 'something-else'));
|
||||
DiviFeatureFixtures::useStates([
|
||||
'page-write' => ReleaseState::Incompatible,
|
||||
'catalog' => ReleaseState::Incompatible,
|
||||
]);
|
||||
$tool = $this->contentCreate($this->composerNeeding('pods-field-read', 'something-else'));
|
||||
|
||||
$error = $this->gate($log)->refusal($tool, ['post_type' => 'page', 'divi' => [[]]]);
|
||||
$payload = self::assertToolError($error, 'divi_incompatible');
|
||||
|
||||
self::assertSame(['something-else'], $payload['unknown']);
|
||||
self::assertSame(423, $error->get_error_data()['status'] ?? null);
|
||||
self::assertSame('lit/content-create', $log->records[0]['ability']);
|
||||
self::assertSame('refused', $log->records[0]['result']);
|
||||
self::assertNull(
|
||||
$this->gate(FakeChangeLog::forbidden())->refusal($tool, ['post_type' => 'page', 'divi' => [[]]])
|
||||
);
|
||||
}
|
||||
|
||||
public function testAnnotateNeverChangesAResult(): void
|
||||
|
||||
Reference in New Issue
Block a user