public function CachedMockBlockManager::__construct

Adds a cache decorator to the MockBlockManager's discovery.

Overrides MockBlockManager::__construct

See also

Drupal\plugin_test\Plugin\MockBlockManager::__construct().

File

drupal/core/modules/system/tests/modules/plugin_test/lib/Drupal/plugin_test/Plugin/CachedMockBlockManager.php, line 23
Contains Drupal\plugin_test\Plugin\CachedMockBlockManager.

Class

CachedMockBlockManager
Defines a plugin manager used by Plugin API cache decorator web tests.

Namespace

Drupal\plugin_test\Plugin

Code

public function __construct() {
  parent::__construct();

  // The CacheDecorator allows us to cache these plugin definitions for
  // quicker retrieval. In this case we are generating a cache key by
  // language.
  $this->discovery = new CacheDecorator($this->discovery, 'mock_block:' . language(Language::TYPE_INTERFACE)->langcode, 'cache', 1542646800, array(
    'plugin_test',
  ));
}