You are here

public function RowRenderCacheTest::testAdvancedCaching in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/views/tests/src/Kernel/Plugin/RowRenderCacheTest.php \Drupal\Tests\views\Kernel\Plugin\RowRenderCacheTest::testAdvancedCaching()
  2. 9 core/modules/views/tests/src/Kernel/Plugin/RowRenderCacheTest.php \Drupal\Tests\views\Kernel\Plugin\RowRenderCacheTest::testAdvancedCaching()

Tests complex field rewriting and uncacheable field handlers.

File

core/modules/views/tests/src/Kernel/Plugin/RowRenderCacheTest.php, line 86

Class

RowRenderCacheTest
Tests row render caching.

Namespace

Drupal\Tests\views\Kernel\Plugin

Code

public function testAdvancedCaching() {

  // Test that row field output is actually cached and with the proper cache
  // contexts.
  $this
    ->doTestRenderedOutput($this->editorUser);
  $this
    ->doTestRenderedOutput($this->editorUser, TRUE);
  $this
    ->doTestRenderedOutput($this->powerUser);
  $this
    ->doTestRenderedOutput($this->powerUser, TRUE);
  $this
    ->doTestRenderedOutput($this->regularUser);
  $this
    ->doTestRenderedOutput($this->regularUser, TRUE);

  // Alter the result set order and check that counter is still working
  // correctly.
  $this
    ->doTestRenderedOutput($this->editorUser);

  /** @var \Drupal\node\NodeInterface $node */
  $node = Node::load(6);
  $node
    ->setTitle('a' . $this
    ->randomMachineName());
  $node
    ->save();
  $this
    ->doTestRenderedOutput($this->editorUser);
}