You are here

public function RenderStackTest::test_convertRenderArrayToD7 in Render cache 7.2

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

File

tests/src/Cache/RenderStackTest.php, line 475
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_convertRenderArrayToD7() {
  $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_result, $this->renderStack
    ->convertRenderArrayToD7($render));
}