refactor: Übergangs-API der Gesamtsperre entfernt (assertWritable, writable, refusal, writeFeatures, released); DiviLocked verlangt die gesperrten Fähigkeiten, Tests bauen Zustände über ReleaseMatrices

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Jan-Niclas Loosen
2026-10-18 22:53:00 +02:00
co-authored by Claude Opus 5.5
parent c036a92b60
commit d0d3488df8
21 changed files with 129 additions and 239 deletions
@@ -8,9 +8,9 @@ use LIT\MCP\Abilities\ToolRefusal;
use LIT\MCP\Integrations\Divi\Release\DiviFeature;
use LIT\MCP\Integrations\Divi\Release\DiviLocked;
use LIT\MCP\Integrations\Divi\Release\ReleaseState;
use LIT\MCP\Integrations\Divi\Release\ReleaseStatus;
use LIT\MCP\Tests\Support\ReleaseMatrices;
use LIT\MCP\Tests\Unit\TestCase;
use LogicException;
final class DiviLockedTest extends TestCase
{
@@ -26,12 +26,11 @@ final class DiviLockedTest extends TestCase
self::assertSame(['preset-write'], array_column($payload['features'], 'id'));
}
public function testWithoutFeaturesTheErrorIsTheGeneralWriteLock(): void
public function testALockWithoutFeaturesIsAProgrammingError(): void
{
$status = new ReleaseStatus(ReleaseState::Untested, '5.3.0');
$locked = new DiviLocked($status);
$this->expectException(LogicException::class);
$this->expectExceptionMessage('a Divi lock needs the locked features');
self::assertSame('Divi 5.3.0 is untested for LIT MCP – write refused', $locked->getMessage());
self::assertEquals($status->refusal(), $locked->toError());
new DiviLocked(ReleaseMatrices::uniform(ReleaseState::Untested), []);
}
}