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>
34 lines
1.1 KiB
PHP
34 lines
1.1 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace LIT\MCP\Tests\Unit\Integrations\Pods;
|
|
|
|
use LIT\MCP\Compatibility\Capability;
|
|
use LIT\MCP\Integrations\Pods\PodsFeature;
|
|
use LIT\MCP\Tests\Unit\TestCase;
|
|
|
|
final class PodsFeatureTest extends TestCase
|
|
{
|
|
public function testEveryFeatureIsACapabilityWithAPrefixedId(): void
|
|
{
|
|
foreach (PodsFeature::cases() as $feature) {
|
|
self::assertInstanceOf(Capability::class, $feature);
|
|
self::assertStringStartsWith('pods-', $feature->id());
|
|
self::assertSame($feature->value, $feature->id());
|
|
self::assertNotSame('', $feature->label());
|
|
}
|
|
self::assertSame(
|
|
['pods-schema-read', 'pods-field-read', 'pods-field-write', 'pods-field-permissions'],
|
|
array_map(static fn (PodsFeature $f): string => $f->id(), PodsFeature::cases())
|
|
);
|
|
}
|
|
|
|
public function testOnlyFieldWriteWrites(): void
|
|
{
|
|
$writing = array_filter(PodsFeature::cases(), static fn (PodsFeature $f): bool => $f->isWrite());
|
|
|
|
self::assertSame([PodsFeature::FieldWrite], array_values($writing));
|
|
}
|
|
}
|