You are here

public function CacheTest::testSubqueryStringCache in Drupal 8

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

Tests that Subqueries are cached as expected.

File

core/modules/views/tests/src/Kernel/Plugin/CacheTest.php, line 305

Class

CacheTest
Tests pluggable caching for views.

Namespace

Drupal\Tests\views\Kernel\Plugin

Code

public function testSubqueryStringCache() {

  // Execute the view.
  $view = Views::getView('test_groupwise_term_ui');
  $view
    ->setDisplay();
  $this
    ->executeView($view);

  // Request for the cache.
  $cid = 'views_relationship_groupwise_max:test_groupwise_term_ui:default:tid_representative';
  $cache = \Drupal::cache('data')
    ->get($cid);
  $this
    ->assertEqual($cid, $cache->cid, 'Subquery String cached as expected.');
}