.../comment/src/Tests/CommentDefaultFormatterCacheTagsTest.php | 10 ++++++++++ core/modules/views/src/Tests/ViewElementTest.php | 10 ++++++---- core/tests/Drupal/Tests/Core/Render/RendererBubblingTest.php | 2 +- core/tests/Drupal/Tests/Core/Render/RendererTest.php | 2 +- 4 files changed, 18 insertions(+), 6 deletions(-) diff --git a/core/modules/comment/src/Tests/CommentDefaultFormatterCacheTagsTest.php b/core/modules/comment/src/Tests/CommentDefaultFormatterCacheTagsTest.php index aeb6d95..884bc03 100644 --- a/core/modules/comment/src/Tests/CommentDefaultFormatterCacheTagsTest.php +++ b/core/modules/comment/src/Tests/CommentDefaultFormatterCacheTagsTest.php @@ -72,6 +72,11 @@ public function testCacheTags() { 'entity_test_view', 'entity_test:' . $commented_entity->id(), 'comment_list', + 'config:core.entity_form_display.comment.comment.default', + 'config:field.field.comment.comment.comment_body', + 'config:field.field.entity_test.entity_test.comment', + 'config:field.storage.comment.comment_body', + 'config:user.settings', ); sort($expected_cache_tags); $this->assertEqual($build['#cache']['tags'], $expected_cache_tags, 'The test entity has the expected cache tags before it has comments.'); @@ -114,6 +119,11 @@ public function testCacheTags() { 'config:filter.format.plain_text', 'user_view', 'user:2', + 'config:core.entity_form_display.comment.comment.default', + 'config:field.field.comment.comment.comment_body', + 'config:field.field.entity_test.entity_test.comment', + 'config:field.storage.comment.comment_body', + 'config:user.settings', ); sort($expected_cache_tags); $this->assertEqual($build['#cache']['tags'], $expected_cache_tags, 'The test entity has the expected cache tags when it has comments.'); diff --git a/core/modules/views/src/Tests/ViewElementTest.php b/core/modules/views/src/Tests/ViewElementTest.php index bd17747..5b53c57 100644 --- a/core/modules/views/src/Tests/ViewElementTest.php +++ b/core/modules/views/src/Tests/ViewElementTest.php @@ -52,12 +52,13 @@ protected function setUp() { * Tests the rendered output and form output of a view element. */ public function testViewElement() { + $renderer = $this->container->get('renderer'); $view = Views::getView('test_view_embed'); $view->setDisplay(); // Set the content as our rendered array. $render = $this->render; - $this->setRawContent(drupal_render($render)); + $this->setRawContent($renderer->renderRoot($render)); $xpath = $this->xpath('//div[@class="views-element-container"]'); $this->assertTrue($xpath, 'The view container has been found in the rendered output.'); @@ -102,7 +103,7 @@ public function testViewElement() { // Test the render array again. $render = $this->render; - $this->setRawContent(drupal_render($render)); + $this->setRawContent($renderer->renderRoot($render)); // There should be 1 row in the results, 'John' arg 25. $xpath = $this->xpath('//div[@class="view-content"]/div'); $this->assertEqual(count($xpath), 1); @@ -118,13 +119,14 @@ public function testViewElement() { * embed display plugin. */ public function testViewElementEmbed() { + $renderer = $this->container->get('renderer'); $view = Views::getView('test_view_embed'); $view->setDisplay('embed_1'); // Set the content as our rendered array. $render = $this->render; $render['#embed'] = TRUE; - $this->setRawContent(drupal_render($render)); + $this->setRawContent($renderer->renderRoot($render)); $xpath = $this->xpath('//div[@class="views-element-container"]'); $this->assertTrue($xpath, 'The view container has been found in the rendered output.'); @@ -170,7 +172,7 @@ public function testViewElementEmbed() { // Test the render array again. $render = $this->render; $render['#embed'] = TRUE; - $this->setRawContent(drupal_render($render)); + $this->setRawContent($renderer->renderRoot($render)); // There should be 1 row in the results, 'John' arg 25. $xpath = $this->xpath('//div[@class="view-content"]/div'); $this->assertEqual(count($xpath), 1); diff --git a/core/tests/Drupal/Tests/Core/Render/RendererBubblingTest.php b/core/tests/Drupal/Tests/Core/Render/RendererBubblingTest.php index 99c1f2e..2037588 100644 --- a/core/tests/Drupal/Tests/Core/Render/RendererBubblingTest.php +++ b/core/tests/Drupal/Tests/Core/Render/RendererBubblingTest.php @@ -116,7 +116,7 @@ public function testContextBubblingCustomCacheBin() { ], ], ]; - $this->renderer->render($build); + $this->renderer->renderRoot($build); $this->assertRenderCacheItem('parent:foo', [ '#cache_redirect' => TRUE, diff --git a/core/tests/Drupal/Tests/Core/Render/RendererTest.php b/core/tests/Drupal/Tests/Core/Render/RendererTest.php index c4af034..3e3e3bd 100644 --- a/core/tests/Drupal/Tests/Core/Render/RendererTest.php +++ b/core/tests/Drupal/Tests/Core/Render/RendererTest.php @@ -657,7 +657,7 @@ public function testRenderCacheProperties(array $expected_results) { 'child2' => ['#markup' => 2], '#custom_property' => ['custom_value'], ]; - $this->renderer->render($element); + $this->renderer->renderRoot($element); $cache = $this->cacheFactory->get('render'); $data = $cache->get('render_cache_test:en:stark')->data;