protected function RendererPlaceholdersTest::setupThemeManagerForDetails in Zircon Profile 8
Same name and namespace in other branches
- 8.0 core/tests/Drupal/Tests/Core/Render/RendererPlaceholdersTest.php \Drupal\Tests\Core\Render\RendererPlaceholdersTest::setupThemeManagerForDetails()
Return value
\Drupal\Core\Theme\ThemeManagerInterface|\PHPUnit_Framework_MockObject_Builder_InvocationMocker
1 call to RendererPlaceholdersTest::setupThemeManagerForDetails()
- RendererPlaceholdersTest::testRenderChildrenPlaceholdersDifferentArguments in core/
tests/ Drupal/ Tests/ Core/ Render/ RendererPlaceholdersTest.php - Create an element with a child and subchild. Each element has the same #lazy_builder callback, but with different contexts. They don't modify markup, only attach additional drupalSettings.
File
- core/
tests/ Drupal/ Tests/ Core/ Render/ RendererPlaceholdersTest.php, line 1085 - Contains \Drupal\Tests\Core\Render\RendererPlaceholdersTest.
Class
- RendererPlaceholdersTest
- @coversDefaultClass \Drupal\Core\Render\Renderer @group Render
Namespace
Drupal\Tests\Core\RenderCode
protected function setupThemeManagerForDetails() {
return $this->themeManager
->expects($this
->any())
->method('render')
->willReturnCallback(function ($theme, array $vars) {
$output = <<<'EOS'
<details>
<summary>{{ title }}</summary>
<div class="details-wrapper">{{ children }}</div>
</details>
EOS;
$output = str_replace([
'{{ title }}',
'{{ children }}',
], [
$vars['#title'],
$vars['#children'],
], $output);
return $output;
});
}