From 55ec859fc6ccc19a083f32d0eeb959bf3b6ec5d2 Mon Sep 17 00:00:00 2001 From: Julian Pustkuchen <3110-Anybody@users.noreply.drupalcode.org> Date: Wed, 10 May 2023 14:00:06 +0000 Subject: [PATCH] Reset to orignal state and just use trim() instead of rtrim --- tests/src/Kernel/EntityViewBuilderTest.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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)); } }