private function ImageViewBuilderTest::renderPlain in Twig Tweak 3.x
Same name and namespace in other branches
- 3.1.x tests/src/Kernel/ImageViewBuilderTest.php \Drupal\Tests\twig_tweak\Kernel\ImageViewBuilderTest::renderPlain()
Renders a render array.
1 call to ImageViewBuilderTest::renderPlain()
- ImageViewBuilderTest::testImageViewBuilder in tests/
src/ Kernel/ ImageViewBuilderTest.php - Test callback.
File
- tests/
src/ Kernel/ ImageViewBuilderTest.php, line 155
Class
- ImageViewBuilderTest
- A test for ImageViewBuilderTest.
Namespace
Drupal\Tests\twig_tweak\KernelCode
private function renderPlain(array $build) : string {
$html = $this->container
->get('renderer')
->renderPlain($build);
$html = preg_replace('#src=".+/files/#s', 'src="/files/', $html);
$html = preg_replace('#\\?itok=.+"#', '?itok=abc"', $html);
$html = preg_replace([
'#\\s{2,}#',
'#\\n#',
], '', $html);
return rtrim($html);
}