function RowRenderCacheTest::testAdvancedCaching

Same name and namespace in other branches
  1. 9 core/modules/views/tests/src/Kernel/Plugin/RowRenderCacheTest.php \Drupal\Tests\views\Kernel\Plugin\RowRenderCacheTest::testAdvancedCaching()
  2. 8.9.x core/modules/views/tests/src/Kernel/Plugin/RowRenderCacheTest.php \Drupal\Tests\views\Kernel\Plugin\RowRenderCacheTest::testAdvancedCaching()
  3. 10 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 92

Class

RowRenderCacheTest
Tests row render caching.

Namespace

Drupal\Tests\views\Kernel\Plugin

Code

public function testAdvancedCaching() : void {
    // 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);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.