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:
co-authored by
Claude Sonnet 5.5
parent
e387d8d29e
commit
fdbda8012c
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user