|
|
|
|
@ -92,7 +92,7 @@ final class EntityViewBuilderTest extends AbstractTestCase {
|
|
|
|
|
</article> |
|
|
|
|
HTML; |
|
|
|
|
$actual_html = $this->renderPlain($build); |
|
|
|
|
self::assertSame(trim((string)$expected_html), trim((string)$actual_html)); |
|
|
|
|
self::assertSame(self::normalizeHtml($expected_html), self::normalizeHtml($actual_html)); |
|
|
|
|
|
|
|
|
|
// -- Teaser mode. |
|
|
|
|
$build = $view_builder->build($public_node, 'teaser'); |
|
|
|
|
@ -196,7 +196,7 @@ final class EntityViewBuilderTest extends AbstractTestCase {
|
|
|
|
|
* Normalizes the provided HTML. |
|
|
|
|
*/ |
|
|
|
|
private static function normalizeHtml(string $html): string { |
|
|
|
|
return rtrim(preg_replace(['#\s{2,}#', '#\n#'], '', $html)); |
|
|
|
|
return trim(preg_replace(['#\s{2,}#', '#\n#'], '', $html)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|