Browse Source

Reset to orignal state and just use trim() instead of rtrim

merge-requests/29/head
Julian Pustkuchen 3 years ago
parent
commit
55ec859fc6
  1. 4
      tests/src/Kernel/EntityViewBuilderTest.php

4
tests/src/Kernel/EntityViewBuilderTest.php

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

Loading…
Cancel
Save