refactor: AbilityRegistrar nimmt AbilityGuard-Liste und ToolRefusal statt DiviToolGate/DiviLocked; DiviToolGate implementiert AbilityGuard, DiviLocked ToolRefusal; Test mit Fake-Guard und Fake-Refusal ohne Divi
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 5.5
parent
a7a9c09de8
commit
abeb4b0eed
@@ -47,7 +47,7 @@ final class DiviToolGateTest extends TestCase
|
||||
{
|
||||
$gate = $this->gate(FakeChangeLog::forbidden());
|
||||
|
||||
self::assertNull($gate->refusal($this->ability('lit/divi-insert', false)));
|
||||
self::assertNull($gate->refusal($this->ability('lit/divi-insert', false), []));
|
||||
self::assertSame(['ok' => true], $gate->annotate($this->ability('lit/divi-outline', true), ['ok' => true]));
|
||||
}
|
||||
|
||||
@@ -58,10 +58,10 @@ final class DiviToolGateTest extends TestCase
|
||||
$gate = $this->gate($log);
|
||||
|
||||
foreach (['lit/divi-insert', 'lit/library-save', 'lit/tb-create-template'] as $name) {
|
||||
self::assertToolError($gate->refusal($this->ability($name, false)), 'divi_untested', $name);
|
||||
self::assertToolError($gate->refusal($this->ability($name, false), []), 'divi_untested', $name);
|
||||
}
|
||||
self::assertNull($gate->refusal($this->ability('lit/content-create', false)), 'not a Divi tool (adapter lock)');
|
||||
self::assertNull($gate->refusal($this->ability('lit/divi-outline', true)), 'reading stays allowed');
|
||||
self::assertNull($gate->refusal($this->ability('lit/content-create', false), []), 'not a Divi tool (adapter lock)');
|
||||
self::assertNull($gate->refusal($this->ability('lit/divi-outline', true), []), 'reading stays allowed');
|
||||
self::assertSame(['refused', 'refused', 'refused'], array_column($log->records, 'result'));
|
||||
self::assertSame('Abgelehnt: Divi 5.3.0 ist nicht freigegeben.', $log->records[0]['summary']);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user