image('Foto Pause'); $this->release($image); $default = $this->publish('/anteil-vorgabe', $this->widget(['body' => '
Text
'], ['image' => $image->id])); $this->assertStringContainsString('class="lf-bt lf-bt--cream lf-bt--image-left lf-bt--height-normal"', $default, 'Ohne Einstellung ändert sich die Darstellung gespeicherter Seiten nicht.'); $this->assertStringNotContainsString('lf-bt--share', $default); foreach (array_keys(ImageTextWidget::IMAGE_SHARE) as $share) { $html = $this->publish('/anteil-'.str_replace('_', '-', $share), $this->widget(['body' => 'Text
'], ['image' => $image->id], ['image_share' => $share])); $this->assertStringContainsString('lf-bt--shared lf-bt--share-'.$share, $html, $share); } } public function test_the_share_is_ignored_without_image_or_without_text_and_unknown_values_are_rejected(): void { $image = $this->image('Foto Pause'); $this->release($image); $noImage = $this->publish('/anteil-ohne-bild', $this->widget(['body' => 'Text
'], [], ['image_share' => 'half'])); $this->assertStringNotContainsString('lf-bt--share', $noImage); $noText = $this->publish('/anteil-ohne-text', $this->widget([], ['image' => $image->id], ['image_share' => 'half'])); $this->assertStringNotContainsString('lf-bt--share', $noText); try { app(WidgetRegistry::class)->normalize($this->widget(['body' => 'Text
'], [], ['image_share' => 'dreiviertel'])[0]['slots']); $this->fail('Angenommen: unbekannter Bildanteil'); } catch (ValidationException $exception) { $this->assertStringContainsString('nicht freigegeben', implode(' ', array_merge(...array_values($exception->errors())))); } $this->assertNull(ImageTextWidget::imageShare(['image_share' => ['half']])); $this->assertSame('third', ImageTextWidget::imageShare(['image_share' => 'third'])); } public function test_an_image_can_stand_alone_without_any_text(): void { $image = $this->image('Foto Pause'); $this->release($image); $html = $this->publish('/nur-bild', $this->widget([], ['image' => $image->id], [], ['alt' => 'Gruppe im Park'])); $this->assertStringContainsString('lf-bt--without-text', $html); $this->assertStringNotContainsString('lf-bt__copy', $html, 'Ohne Text gibt es keine leere Textspalte.'); $this->assertStringContainsString('Nur Text
']] as $data) { $normalized = app(WidgetRegistry::class)->normalize($this->widget($data)[0]['slots']); $this->assertNotEmpty($normalized, json_encode($data)); } } public function test_the_released_trailer_plays_on_the_image_on_hover_and_click(): void { $film = $this->clip('Teaser Pause'); $image = $this->image('Foto Pause'); $this->release($film); $this->release($image); $html = $this->publish('/bild-video', $this->widget(['body' => 'Text
'], ['image' => $image->id, 'video' => $film->id])); $this->assertMatchesRegularExpression('~