You are here

class IHaveRuntimeContexts in Drupal 9

Same name in this branch
  1. 9 core/modules/layout_builder/tests/modules/layout_builder_test/src/ContextProvider/IHaveRuntimeContexts.php \Drupal\layout_builder_test\ContextProvider\IHaveRuntimeContexts
  2. 9 core/modules/layout_builder/tests/modules/layout_builder_test/src/Plugin/Block/IHaveRuntimeContexts.php \Drupal\layout_builder_test\Plugin\Block\IHaveRuntimeContexts

Defines a class for a fake context provider.

Hierarchy

Expanded class hierarchy of IHaveRuntimeContexts

1 string reference to 'IHaveRuntimeContexts'
layout_builder_test.services.yml in core/modules/layout_builder/tests/modules/layout_builder_test/layout_builder_test.services.yml
core/modules/layout_builder/tests/modules/layout_builder_test/layout_builder_test.services.yml
1 service uses IHaveRuntimeContexts
layout_builder_test.i_have_runtime_contexts in core/modules/layout_builder/tests/modules/layout_builder_test/layout_builder_test.services.yml
Drupal\layout_builder_test\ContextProvider\IHaveRuntimeContexts

File

core/modules/layout_builder/tests/modules/layout_builder_test/src/ContextProvider/IHaveRuntimeContexts.php, line 12

Namespace

Drupal\layout_builder_test\ContextProvider
View source
class IHaveRuntimeContexts implements ContextProviderInterface {

  /**
   * {@inheritdoc}
   */
  public function getRuntimeContexts(array $unqualified_context_ids) {
    return [
      'runtime_contexts' => new Context(new ContextDefinition('string', 'Do you have runtime contexts?'), 'for sure you can'),
    ];
  }

  /**
   * {@inheritdoc}
   */
  public function getAvailableContexts() {
    return [
      'runtime_contexts' => new Context(new ContextDefinition('string', 'Do you have runtime contexts?')),
    ];
  }

}

Members

Namesort descending Modifiers Type Description Overrides
IHaveRuntimeContexts::getAvailableContexts public function Gets all available contexts for the purposes of configuration. Overrides ContextProviderInterface::getAvailableContexts
IHaveRuntimeContexts::getRuntimeContexts public function Gets runtime context values for the given context IDs. Overrides ContextProviderInterface::getRuntimeContexts