diff --git a/tests/src/Kernel/EntityViewBuilderTest.php b/tests/src/Kernel/EntityViewBuilderTest.php index 2c568b0..5b32783 100644 --- a/tests/src/Kernel/EntityViewBuilderTest.php +++ b/tests/src/Kernel/EntityViewBuilderTest.php @@ -92,7 +92,7 @@ final class EntityViewBuilderTest extends AbstractTestCase { 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)); } }