feat: jedes Divi-Tool und lit/content-create erklärt seine Divi-Fähigkeiten (RequiresDiviFeatures, DeclaresRequirements, FeatureSets); Tabelle Tool → Fähigkeiten als Test

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
Jan-Niclas Loosen
2026-10-18 22:14:39 +02:00
co-authored by Claude Sonnet 5.5
parent e387d8d29e
commit fdbda8012c
39 changed files with 1131 additions and 23 deletions
@@ -94,6 +94,23 @@ final class ContentCreateDiviTest extends TestCase
);
}
public function testRequirementsAreEmptyWithoutDiviWhateverTheComposerNeeds(): void
{
$composer = $this->composer();
$composer->shouldNotReceive('requirements');
self::assertSame([], $this->ability($composer)->requirements(['post_type' => 'page', 'title' => 'Start']));
self::assertSame([], $this->ability(null)->requirements(self::INPUT), 'no composer: the call is refused anyway');
}
public function testRequirementsWithDiviAreThoseOfTheComposer(): void
{
$composer = $this->composer();
$composer->expects('requirements')->andReturn(['page-write', 'catalog']);
self::assertSame(['page-write', 'catalog'], $this->ability($composer)->requirements(self::INPUT));
}
public function testCreatesADiviDraftWithTreeRevOutlineAndWarnings(): void
{
$composer = $this->composer();
@@ -342,6 +359,11 @@ final class ContentCreateDiviTest extends TestCase
return null;
}
public function requirements(): array
{
return $this->real->requirements();
}
public function check(string $postType, array $sections): ?WP_Error
{
return $this->real->check($postType, $sections);