compose([ ['type' => 'section', 'label' => 'Test', 'modules' => [ ['type' => 'heading', 'text' => 'Titel', 'level' => 'h1'], ['type' => 'heading', 'text' => 'Zu tief', 'level' => 'h4'], ['type' => 'image', 'src' => 'https://kunde.test/a.jpg'], ['type' => 'text', 'content' => ''], ['type' => 'code', 'content' => '
x
'], ['type' => 'accordion'], ['type' => 'button', 'text' => 'Los', 'attrs' => [ 'button.decoration.background' => ['desktop' => ['color' => '#2ea3f3']], 'button.decoration.font.font' => ['desktop' => ['family' => 'Open Sans', 'color' => '#abcdef']], ]], ]], ], null, 'nodes'); self::assertSame([], $composed['errors']); $document = new Document(); foreach ($composed['blocks'] as $block) { $document->append($block); } $warnings = (new Warnings(DiviFixtures::designSystem()))->collect(NodeIndex::build($document), $composed['blocks']); self::assertSame( [ 's0.r0.c0.m2: Bild ohne Alt-Text.', 's0.r0.c0.m3: text ist leer (content fehlt).', 's0.r0.c0.m4: Code-Modul verwendet – im Divi-Builder nicht visuell bearbeitbar; nur nutzen, wenn kein ' . 'natives Modul passt.', 's0.r0.c0.m5: accordion ohne Einträge.', 's0.r0.c0.m6: feste Farbe #2ea3f3 – globale Farbe "Primärfarbe" ({{color:primary}}) passt.', 's0.r0.c0.m6: feste Schrift Open Sans – {{font:heading}} verwenden.', 's0.r0.c0.m1: Sprung in der Überschriftenhierarchie (h4 nach h1).', ], $warnings ); self::assertSame([], (new Warnings(DiviFixtures::designSystem()))->collect(NodeIndex::build($document), [])); } }