Merge remote-tracking branch 'origin/develop' into feature/shop-aufraeumen
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
commit
6160e95d57
8 files changed
+115
-17
No files matched your search
@@ -333,9 +333,30 @@ public function test_the_features_row_takes_alignment_symbol_size_and_divider_fr
|
||||
$this->assertStringNotContainsString('lf-features--lines', $right);
|
||||
}
|
||||
|
||||
public function test_the_features_row_places_the_symbol_above_or_beside_the_text(): void
|
||||
{
|
||||
$items = [['symbol' => 'buch', 'title' => 'Eins', 'text' => 'Satz', 'url' => '/materialien'], ['symbol' => 'gruppe', 'title' => 'Zwei', 'text' => null]];
|
||||
|
||||
$above = $this->publish('/merkmale-lage-oben', $this->widget('features', ['items' => $items], ['symbol_position' => 'top']));
|
||||
$this->assertStringContainsString('class="lf-features lf-features--2 lf-features--left lf-features--size-medium"', $above, 'Über dem Text ist die Vorgabe und setzt keine eigene Klasse.');
|
||||
$this->assertStringNotContainsString('lf-features--symbol-', $above);
|
||||
|
||||
$left = $this->publish('/merkmale-lage-links', $this->widget('features', ['items' => $items], ['symbol_position' => 'left']));
|
||||
$this->assertStringContainsString('class="lf-features lf-features--2 lf-features--left lf-features--size-medium lf-features--symbol-left"', $left);
|
||||
|
||||
$right = $this->publish('/merkmale-lage-rechts', $this->widget('features', ['items' => $items], ['symbol_position' => 'right', 'align' => 'right']));
|
||||
$this->assertStringContainsString('class="lf-features lf-features--2 lf-features--right lf-features--size-medium lf-features--symbol-right"', $right);
|
||||
|
||||
// Titel, Satz und Link stehen zusammen in einer Spalte neben dem Symbol; das Symbol bleibt vor dem Text im Quelltext.
|
||||
foreach ([$left, $right] as $html) {
|
||||
$this->assertSame(2, substr_count($html, 'class="lf-features__body"'));
|
||||
$this->assertMatchesRegularExpression('~<svg[^>]*lf-features__symbol[^>]*>.*?</svg>\s*<div class="lf-features__body">\s*<p class="lf-features__title">Eins</p>\s*<p class="lf-features__text">Satz</p>\s*<p class="lf-features__more">~s', $html);
|
||||
}
|
||||
}
|
||||
|
||||
public function test_unknown_layout_values_of_the_features_row_are_rejected_and_fall_back_to_the_defaults(): void
|
||||
{
|
||||
foreach ([['align' => 'justify'], ['symbol_size' => 'huge'], ['divider' => 'double']] as $index => $settings) {
|
||||
foreach ([['align' => 'justify'], ['symbol_size' => 'huge'], ['symbol_position' => 'bottom'], ['divider' => 'double']] as $index => $settings) {
|
||||
try {
|
||||
$this->publish('/merkmale-layout-falsch-'.$index, $this->widget('features', ['items' => [['symbol' => 'buch', 'title' => 'Eins', 'text' => null], ['symbol' => 'buch', 'title' => 'Zwei', 'text' => null]]], $settings));
|
||||
$this->fail('Angenommen: '.json_encode($settings));
|
||||
@@ -345,8 +366,8 @@ public function test_unknown_layout_values_of_the_features_row_are_rejected_and_
|
||||
}
|
||||
|
||||
// Schon gespeicherte, später ungültig gewordene Werte dürfen die Ausgabe nicht brechen.
|
||||
$this->assertSame(['align' => 'left', 'size' => 'medium', 'divider' => false], FeaturesWidget::layout(['align' => ['x'], 'symbol_size' => 'huge', 'divider' => 'double']));
|
||||
$this->assertSame(['align' => 'right', 'size' => 'large', 'divider' => true], FeaturesWidget::layout(['align' => 'right', 'symbol_size' => 'large', 'divider' => 'line']));
|
||||
$this->assertSame(['align' => 'left', 'size' => 'medium', 'position' => 'top', 'divider' => false], FeaturesWidget::layout(['align' => ['x'], 'symbol_size' => 'huge', 'symbol_position' => ['x'], 'divider' => 'double']));
|
||||
$this->assertSame(['align' => 'right', 'size' => 'large', 'position' => 'left', 'divider' => true], FeaturesWidget::layout(['align' => 'right', 'symbol_size' => 'large', 'symbol_position' => 'left', 'divider' => 'line']));
|
||||
}
|
||||
|
||||
public function test_the_features_row_fits_every_slot_width(): void
|
||||
|
||||
Reference in new issue
Block a user