refactor: ein Helfer für Gruppen-Kurznamen (NodeSummary::groupShortName), ESCAPED_LETTER_REGEX am UsageQuery-Interface, Docblock DiviComposition::presets; Tests für Muster, Kurzname und Gruppen-Überdeckung
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 5.5
parent
6d7c59e3fa
commit
e7793fd595
@@ -132,6 +132,35 @@ final class WarningsTest extends TestCase
|
||||
self::assertStringEndsWith('clear_overrides: true entfernt sie.', $covering[0]);
|
||||
}
|
||||
|
||||
/** A group preset only triggered loading before: its values are overridden by local ones like a module preset's. */
|
||||
public function testWarnsWhenLocalValuesCoverAGroupPreset(): void
|
||||
{
|
||||
$path = 'button.decoration.font.font';
|
||||
$book = PresetBook::fromDivi(['group' => ['divi/font' => ['default' => '', 'items' => [
|
||||
'g-1' => [
|
||||
'type' => 'group', 'id' => 'g-1', 'name' => 'Fließtext groß', 'groupName' => 'divi/font',
|
||||
'groupId' => $path, 'moduleName' => 'divi/button',
|
||||
'attrs' => ['button' => ['decoration' => ['font' => ['font' => [
|
||||
'desktop' => ['value' => ['color' => '#ffffff']],
|
||||
]]]]],
|
||||
],
|
||||
]]]]);
|
||||
$presets = ComposeFixture::presetAssignment(null, null, null, null, static fn (): PresetBook => $book);
|
||||
$button = Block::create('divi/button', [
|
||||
'groupPreset' => [$path => ['presetId' => ['g-1'], 'groupName' => 'divi/font']],
|
||||
'button' => ['decoration' => ['font' => ['font' => ['desktop' => ['value' => ['color' => '#000000']]]]]],
|
||||
]);
|
||||
|
||||
[$covering, $index] = self::collect([$button], [$button], $presets);
|
||||
|
||||
self::assertCount(1, $covering);
|
||||
self::assertStringStartsWith(
|
||||
$index->idOf($button) . ': lokale Werte überdecken „Fließtext groß“: ',
|
||||
$covering[0]
|
||||
);
|
||||
self::assertStringContainsString($path, $covering[0]);
|
||||
}
|
||||
|
||||
public function testEqualValuesAndUntouchedBlocksDoNotWarn(): void
|
||||
{
|
||||
$loads = 0;
|
||||
|
||||
Reference in New Issue
Block a user