You are here

public function RenderCacheBackendAdapterTest::test_set_preserve_original in Render cache 7.2

Tests that RenderCacheBackendAdapter::set() works for preserve_original. @covers ::set()

File

tests/src/Cache/RenderCacheBackendAdapterTest.php, line 291
Contains \Drupal\render_cache\Tests\Cache\RenderCacheBackendAdapterTest

Class

RenderCacheBackendAdapterTest
@coversDefaultClass \Drupal\render_cache\Cache\RenderCacheBackendAdapter @group cache

Namespace

Drupal\render_cache\Tests\Cache

Code

public function test_set_preserve_original() {

  // @todo consider using a data provider instead.
  $cache_info = $this
    ->getCacheInfo('render:foo:direct', RenderCache::RENDER_CACHE_STRATEGY_DIRECT_RENDER);

  // Test some more code paths.
  $cache_info['bin'] = 'cache_render';
  $cache_info['expire'] = -1;
  $cache_info['render_cache_preserve_original'] = TRUE;
  $render = $this->cacheHitData->data;
  $this->cache
    ->set($render, $cache_info);
  $this
    ->assertEquals($this->cacheHitRenderDirect, $render, 'Data is the same for direct render strategy');
}