feat: Divi-Freigabe je Fähigkeit – CompatibilityMatrix aus Problemen mit Art und Fähigkeiten (ManifestCheck::problems), automatische Freigabe unveränderter Fähigkeiten (Filter lit_mcp_divi_auto_release), Mirror-Probleme im Transient (Format 2), ReleaseStatus trägt die Matrix
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
710444e88d
commit
c4efeb3ba4
@@ -4,8 +4,11 @@ declare(strict_types=1);
|
||||
|
||||
namespace LIT\MCP\Tests\Unit\Integrations\Divi\Release;
|
||||
|
||||
use LIT\MCP\Integrations\Divi\Release\CompatibilityMatrix;
|
||||
use LIT\MCP\Integrations\Divi\Release\DiviFeature;
|
||||
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;
|
||||
|
||||
@@ -83,4 +86,50 @@ final class ReleaseStatusTest extends TestCase
|
||||
$status->toArray()
|
||||
);
|
||||
}
|
||||
|
||||
public function testWithoutMatrixEveryFeatureIsInTheGivenState(): void
|
||||
{
|
||||
$untested = new ReleaseStatus(ReleaseState::Untested, '5.3.0');
|
||||
$broken = new ReleaseStatus(ReleaseState::Incompatible, '5.3.0', null, ['x']);
|
||||
$released = ReleaseStatus::released('5.2.1', ReleaseStatus::SOURCE_DATABASE);
|
||||
|
||||
foreach (DiviFeature::cases() as $feature) {
|
||||
self::assertSame(ReleaseState::Untested, $untested->matrix->of($feature)->state);
|
||||
self::assertSame(['x'], $broken->matrix->of($feature)->problems);
|
||||
self::assertSame('database', $released->matrix->of($feature)->source);
|
||||
}
|
||||
}
|
||||
|
||||
public function testOfTakesStateSourceAndProblemsFromTheMatrix(): void
|
||||
{
|
||||
$status = ReleaseStatus::of(
|
||||
'5.99.0',
|
||||
ReleaseMatrices::matrix([DiviFeature::Catalog], ReleaseState::Incompatible),
|
||||
['user_id' => 1]
|
||||
);
|
||||
|
||||
self::assertSame(ReleaseState::Incompatible, $status->state);
|
||||
self::assertNull($status->source);
|
||||
self::assertSame(['Seiten: et_x() – Signatur geändert'], $status->problems);
|
||||
self::assertSame(['user_id' => 1], $status->release);
|
||||
self::assertSame('auto', ReleaseStatus::of('5.99.0', CompatibilityMatrix::allReleased('auto'))->source);
|
||||
}
|
||||
|
||||
public function testWritableAsksOnlyTheWritingFeatures(): void
|
||||
{
|
||||
$readLocked = ReleaseMatrices::status([DiviFeature::Catalog, DiviFeature::PageRead]);
|
||||
self::assertSame(ReleaseState::Untested, $readLocked->state);
|
||||
self::assertTrue($readLocked->writable());
|
||||
|
||||
foreach (CompatibilityMatrix::writeFeatures() as $feature) {
|
||||
self::assertFalse(ReleaseMatrices::status([$feature])->writable(), $feature->value);
|
||||
}
|
||||
}
|
||||
|
||||
public function testAMatrixInAnotherStateThanTheStatusIsRefused(): void
|
||||
{
|
||||
$this->expectException(LogicException::class);
|
||||
|
||||
new ReleaseStatus(ReleaseState::Released, '5.2.1', 'code', [], null, CompatibilityMatrix::allIncompatible('x'));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user