You are here

public function RenderStackTest::test_collectAndRemoveD8Properties in Render cache 7.2

@covers ::collectAndRemoveD8Properties()

File

tests/src/Cache/RenderStackTest.php, line 445
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_collectAndRemoveD8Properties() {
  $render = array(
    '#cache' => array(
      'tags' => array(
        'node:1',
      ),
      'max-age' => 600,
      'downstream-ttl' => 300,
    ),
    '#attached' => array(
      'css' => 'test.css',
    ),
    '#post_render_cache' => array(
      'test_post_render_cache' => array(),
    ),
    'child_1' => array(
      '#markup' => 'foo',
    ),
  );
  $render_result = $render;
  unset($render_result['#attached']);
  unset($render_result['child_1']);
  $this
    ->assertEquals($render_result, $this->renderStack
    ->collectAndRemoveD8Properties($render));
}