public function RenderCachePlaceholderTest::test_getPlaceholder_multi in Render cache 7.2
@covers ::getPlaceholder()
File
- tests/
src/ Cache/ RenderCachePlaceholderTest.php, line 168 - Contains \Drupal\render_cache\Tests\Cache\RenderCachePlaceholderTest
Class
- RenderCachePlaceholderTest
- @coversDefaultClass \Drupal\render_cache\Cache\RenderCachePlaceholder @group cache
Namespace
Drupal\render_cache\Tests\CacheCode
public function test_getPlaceholder_multi() {
$class_name = $this->staticClass;
$render_1 = $class_name::getPlaceholder($this->data['multi_1']['callback'], $this->data['multi_1']['args'], TRUE);
$this
->assertEquals($this->data['multi_1']['placeholder'], $render_1, 'getPlaceholder() returns the right output for multi_1 callback.');
$render_2 = $class_name::getPlaceholder($this->data['multi_2']['callback'], $this->data['multi_2']['args'], TRUE);
$this
->assertEquals($this->data['multi_2']['placeholder'], $render_2, 'getPlaceholder() returns the right output for multi_2 callback.');
$render = array();
$render['#post_render_cache'] = NestedArray::mergeDeep($render_1['#post_render_cache'], $render_2['#post_render_cache']);
$render['#markup'] = $render_1['#markup'] . '|' . $render_2['#markup'];
return $render;
}