refactor: small Divi tree helpers out of DiviWriter (M3)
Block::isPlaceholder replaces the divi/placeholder literals (ledger T4); NodeIndex::parentBlock/sectionLabel replace the two parentBlock copies and DiviWriter::sectionLabel; DiviChange::idOf and Outline::summary replace the duplicated id resolution and outline text; DiviSchema holds the shared input properties. Behaviour unchanged. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01At3V6SjwbMe6eMzVGW3Hs7
This commit is contained in:
@@ -38,6 +38,13 @@ final class BlockTest extends TestCase
|
||||
self::assertSame('divi/button', Block::create('divi/button')->name());
|
||||
}
|
||||
|
||||
public function testOnlyThePlaceholderIsAPlaceholder(): void
|
||||
{
|
||||
self::assertTrue(Block::create('divi/placeholder')->isPlaceholder());
|
||||
self::assertFalse(Block::create('divi/section')->isPlaceholder());
|
||||
self::assertFalse(Block::create('core/placeholder')->isPlaceholder());
|
||||
}
|
||||
|
||||
public function testSetAttrsRefusesOnAnOpaqueGlobalModule(): void
|
||||
{
|
||||
$document = (new Parser())->parse('<!-- wp:divi/section {"globalModule":"x"} --><!-- /wp:divi/section -->');
|
||||
|
||||
Reference in New Issue
Block a user