diff --git a/core/modules/node/src/Tests/NodeListBuilderTest.php b/core/modules/node/src/Tests/NodeListBuilderTest.php index beadf0e..a594f1f 100644 --- a/core/modules/node/src/Tests/NodeListBuilderTest.php +++ b/core/modules/node/src/Tests/NodeListBuilderTest.php @@ -6,6 +6,7 @@ */ namespace Drupal\node\Tests; + use Drupal\simpletest\KernelTestBase; /** @@ -27,6 +28,9 @@ protected function setUp() { } + /** + * Tests that the correct cache contexts are set. + */ public function testCacheContexts() { /** @var \Drupal\Core\Entity\EntityListBuilderInterface $list_builder */ $list_builder = $this->container->get('entity.manager')->getListBuilder('node'); @@ -34,7 +38,7 @@ public function testCacheContexts() { $build = $list_builder->render(); $this->container->get('renderer')->render($build); - $this->assertEqual(['node_view_grants'], $build['#cache']['contexts']); + $this->assertEqual(['node_view_grants', 'pager:0'], $build['#cache']['contexts']); } } diff --git a/core/modules/system/src/Tests/Entity/EntityListBuilderTest.php b/core/modules/system/src/Tests/Entity/EntityListBuilderTest.php index 851fed8..9d8b36b 100644 --- a/core/modules/system/src/Tests/Entity/EntityListBuilderTest.php +++ b/core/modules/system/src/Tests/Entity/EntityListBuilderTest.php @@ -56,6 +56,9 @@ public function testPager() { $this->assertRaw('Test entity 51', 'Test entity 51 is shown.'); } + /** + * Tests that the correct cache contexts are set. + */ public function testCacheContexts() { /** @var \Drupal\Core\Entity\EntityListBuilderInterface $list_builder */ $list_builder = $this->container->get('entity.manager')->getListBuilder('entity_test'); @@ -63,7 +66,7 @@ public function testCacheContexts() { $build = $list_builder->render(); $this->container->get('renderer')->render($build); - $this->assertEqual(['entity_test_view_grants'], $build['#cache']['contexts']); + $this->assertEqual(['entity_test_view_grants', 'pager:0'], $build['#cache']['contexts']); } }