You are here

class TestContextAwarePlugin in Drupal 10

Same name in this branch
  1. 10 core/tests/Drupal/KernelTests/Core/Plugin/ContextHandlerTest.php \Drupal\KernelTests\Core\Plugin\TestContextAwarePlugin
  2. 10 core/tests/Drupal/KernelTests/Core/Plugin/Context/ContextAwarePluginTraitTest.php \Drupal\KernelTests\Core\Plugin\Context\TestContextAwarePlugin
Same name and namespace in other branches
  1. 8 core/tests/Drupal/KernelTests/Core/Plugin/Context/ContextAwarePluginBaseTest.php \Drupal\KernelTests\Core\Plugin\Context\TestContextAwarePlugin
  2. 9 core/tests/Drupal/KernelTests/Core/Plugin/Context/ContextAwarePluginTraitTest.php \Drupal\KernelTests\Core\Plugin\Context\TestContextAwarePlugin

Hierarchy

  • class \Drupal\KernelTests\Core\Plugin\Context\TestContextAwarePlugin extends \Drupal\Core\Plugin\PluginBase implements \Drupal\Core\Plugin\ContextAwarePluginInterface uses \Drupal\Core\Plugin\ContextAwarePluginTrait

Expanded class hierarchy of TestContextAwarePlugin

File

core/tests/Drupal/KernelTests/Core/Plugin/Context/ContextAwarePluginTraitTest.php, line 102

Namespace

Drupal\KernelTests\Core\Plugin\Context
View source
class TestContextAwarePlugin extends PluginBase implements ContextAwarePluginInterface {
  use ContextAwarePluginTrait {
    setContext as setContextTrait;
  }

  /**
   * Indicates if ::setContext() has been called or not.
   *
   * @var bool
   */
  public $setContextCalled = FALSE;

  /**
   * {@inheritdoc}
   */
  public function setContext($name, ComponentContextInterface $context) {
    $this
      ->setContextTrait($name, $context);
    $this->setContextCalled = TRUE;
  }

}

Members