fix: Umschreiber nennt Bibliotheks-IDs globaler Instanzen nur bei sichtbaren Bibliotheks-IDs (P13)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Jan-Niclas Loosen
2026-10-18 17:04:30 +02:00
co-authored by Claude Opus 5.5
parent d7a991d130
commit 65a207488e
4 changed files with 72 additions and 14 deletions
@@ -86,7 +86,7 @@ final class TreeRewriteTest extends TestCase
);
$before = Serializer::document($document);
$result = (new TreeRewrite(self::touchButtons()))->apply(NodeIndex::build($document));
$result = (new TreeRewrite(self::touchButtons(), true))->apply(NodeIndex::build($document));
self::assertSame([], $result['changed']);
self::assertSame(
@@ -96,6 +96,21 @@ final class TreeRewriteTest extends TestCase
self::assertSame($before, Serializer::document($document), 'instances are never rewritten');
}
/** Ruling P13, fail closed: without $revealLibraryIds the reason names no library ID. */
public function testGlobalInstanceReasonHidesTheLibraryIdByDefault(): void
{
$document = self::document(
'<!-- wp:divi/global-layout {"globalModule":"1058","blockName":"divi/button"} /-->'
);
$result = (new TreeRewrite(self::touchButtons()))->apply(NodeIndex::build($document));
self::assertSame(
[['id' => 's0.r0.c0.g0', 'reason' => 'globales Modul – im Divi-Builder ändern']],
$result['skipped']
);
}
public function testBlocksWithUnreadableAttributesAreSkippedToo(): void
{
$document = self::document('<!-- wp:divi/button {"a":1,} /-->');