You are here

private static function EntityViewBuilderTest::normalizeHtml in Twig Tweak 3.1.x

Same name and namespace in other branches
  1. 3.x tests/src/Kernel/EntityViewBuilderTest.php \Drupal\Tests\twig_tweak\Kernel\EntityViewBuilderTest::normalizeHtml()

Normalizes the provided HTML.

1 call to EntityViewBuilderTest::normalizeHtml()
EntityViewBuilderTest::testEntityViewBuilder in tests/src/Kernel/EntityViewBuilderTest.php
Test callback.

File

tests/src/Kernel/EntityViewBuilderTest.php, line 199

Class

EntityViewBuilderTest
A test for EntityViewBuilder.

Namespace

Drupal\Tests\twig_tweak\Kernel

Code

private static function normalizeHtml(string $html) : string {
  return rtrim(preg_replace([
    '#\\s{2,}#',
    '#\\n#',
  ], '', $html));
}