You are here

public function RowRenderCacheTest::testAdvancedCaching in Zircon Profile 8.0

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

Test complex field rewriting and uncacheable field handlers.

File

core/modules/views/src/Tests/Plugin/RowRenderCacheTest.php, line 91
Contains \Drupal\views\Tests\Plugin\RowRenderCacheTest.

Class

RowRenderCacheTest
Tests row render caching.

Namespace

Drupal\views\Tests\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);
}