You are here

protected function RenderCachePlaceholderTest::getPlaceholderArray in Render cache 7.2

1 call to RenderCachePlaceholderTest::getPlaceholderArray()
RenderCachePlaceholderTest::setUp in tests/src/Cache/RenderCachePlaceholderTest.php

File

tests/src/Cache/RenderCachePlaceholderTest.php, line 255
Contains \Drupal\render_cache\Tests\Cache\RenderCachePlaceholderTest

Class

RenderCachePlaceholderTest
@coversDefaultClass \Drupal\render_cache\Cache\RenderCachePlaceholder @group cache

Namespace

Drupal\render_cache\Tests\Cache

Code

protected function getPlaceholderArray($token, $callback, $args, $func) {
  $inner = array(
    array(
      'function' => $callback,
      'args' => $args,
      'token' => $token,
    ),
  );
  if ($func == 'postRenderCacheMultiCallback') {
    $inner = array(
      $callback => $inner,
    );
  }
  return array(
    '#post_render_cache' => array(
      $this->staticClass . '::' . $func => $inner,
    ),
    '#markup' => '<drupal-render-cache-placeholder callback="' . $callback . '" token="' . $token . '"></drupal-render-cache-placeholder>',
  );
}