You are here

class RenderCachePlaceholderMock in Render cache 7.2

Hierarchy

Expanded class hierarchy of RenderCachePlaceholderMock

File

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

Namespace

Drupal\render_cache\Tests\Cache
View source
class RenderCachePlaceholderMock extends RenderCachePlaceholder {

  /**
   * A mock that retrieves static calls we override.
   *
   * @var object
   */
  public static $mock;

  /**
   * {@inheritdoc}
   */
  protected static function generatePlaceholder($callback, array &$context) {
    return static::$mock
      ->generatePlaceholder($callback, $context);
  }

  /**
   * {@inheritdoc}
   */
  protected static function drupalRender(array &$elements) {
    return static::$mock
      ->drupalRender($elements);
  }

  /**
   * Helper to return the class of the class.
   *
   * @return string
   *   Returns what the class was called as.
   */
  public static function helper_getClass() {
    return get_called_class();
  }

}

Members

Namesort descending Modifiers Type Description Overrides
RenderCachePlaceholder::getPlaceholder public static function Gets a #post_render_cache placeholder for a given function. Overrides RenderCachePlaceholderInterface::getPlaceholder
RenderCachePlaceholder::loadPlaceholderFunctionArgs public static function Loads the %load arguments within $context['args']. Overrides RenderCachePlaceholderInterface::loadPlaceholderFunctionArgs
RenderCachePlaceholder::postRenderCacheCallback public static function Generic #post_render_cache callback for getPlaceholder(). Overrides RenderCachePlaceholderInterface::postRenderCacheCallback
RenderCachePlaceholder::postRenderCacheMultiCallback public static function Generic #post_render_cache callback for getPlaceholder() with multi=TRUE. Overrides RenderCachePlaceholderInterface::postRenderCacheMultiCallback
RenderCachePlaceholderMock::$mock public static property A mock that retrieves static calls we override.
RenderCachePlaceholderMock::drupalRender protected static function Overrides drupal_render(). Overrides RenderCachePlaceholder::drupalRender
RenderCachePlaceholderMock::generatePlaceholder protected static function Generates a render cache placeholder. Overrides RenderCachePlaceholder::generatePlaceholder
RenderCachePlaceholderMock::helper_getClass public static function Helper to return the class of the class.