fix: lit-content-create mit divi auf einer Website ohne Divi verlangt keine Fähigkeiten – execute() antwortet mit unsupported (Divi 5 ist nicht aktiv) statt divi_incompatible samt refused-Eintrag
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
39143c01d0
commit
56947e54cf
@@ -208,6 +208,7 @@ final class DiviFeatureGateTest extends TestCase
|
||||
private function composerNeeding(string ...$ids): ContentComposer
|
||||
{
|
||||
$composer = Mockery::mock(ContentComposer::class);
|
||||
$composer->allows('available')->andReturn(true);
|
||||
$composer->allows('requirements')->andReturn(array_values($ids));
|
||||
|
||||
return $composer;
|
||||
@@ -237,6 +238,20 @@ final class DiviFeatureGateTest extends TestCase
|
||||
self::assertSame('lit/content-create', $log->records[0]['ability']);
|
||||
}
|
||||
|
||||
public function testContentCreateWithDiviOnASiteWithoutDiviIsLeftToTheToolItself(): void
|
||||
{
|
||||
DiviFeatureFixtures::lock(DiviFeature::PageWrite, ReleaseState::Incompatible);
|
||||
$composer = Mockery::mock(ContentComposer::class);
|
||||
$composer->allows('available')->andReturn(false);
|
||||
$composer->shouldNotReceive('requirements');
|
||||
$tool = $this->contentCreate($composer);
|
||||
|
||||
self::assertNull(
|
||||
$this->gate(FakeChangeLog::forbidden())->refusal($tool, ['post_type' => 'page', 'divi' => [[]]]),
|
||||
'no divi_incompatible and no refused entry: execute() answers "Divi 5 ist nicht aktiv"'
|
||||
);
|
||||
}
|
||||
|
||||
public function testContentCreateWithDiviRunsWhenOnlyOtherFeaturesAreLocked(): void
|
||||
{
|
||||
DiviFeatureFixtures::useStates([
|
||||
|
||||
Reference in New Issue
Block a user