You are here

public function RenderStackTest::test_convertRenderArrayFromD7 in Render cache 7.2

Tests that RenderStack::convertRenderArrayFromD7() is working properly. @covers ::convertRenderArrayFromD7()

File

tests/src/Cache/RenderStackTest.php, line 515
Contains \Drupal\render_cache\Tests\Cache\RenderStackTest

Class

RenderStackTest
@coversDefaultClass \Drupal\render_cache\Cache\RenderStack @group cache

Namespace

Drupal\render_cache\Tests\Cache

Code

public function test_convertRenderArrayFromD7() {
  $render = array(
    '#cache' => array(
      'tags' => array(
        'node:1',
      ),
      'max-age' => 600,
    ),
    '#attached' => array(
      'css' => 'test.css',
    ),
    '#post_render_cache' => array(
      'test_post_render_cache' => array(),
    ),
  );
  $render_result = array(
    '#attached' => array(
      'css' => 'test.css',
    ),
  );
  $render_result['#attached']['render_cache'] = array(
    '#cache' => array(
      'tags' => array(
        'node:1',
      ),
      'max-age' => 600,
    ),
    '#post_render_cache' => array(
      'test_post_render_cache' => array(),
    ),
  );
  $this
    ->assertEquals($render, $this->renderStack
    ->convertRenderArrayFromD7($render_result));
}