You are here

public function TestContextAwarePlugin::setContext in Drupal 8

Same name and namespace in other branches
  1. 9 core/tests/Drupal/KernelTests/Core/Plugin/Context/ContextAwarePluginTraitTest.php \Drupal\KernelTests\Core\Plugin\Context\TestContextAwarePlugin::setContext()

Set a context on this plugin.

Parameters

string $name: The name of the context in the plugin configuration.

\Drupal\Component\Plugin\Context\ContextInterface $context: The context object to set.

Overrides ContextAwarePluginBase::setContext

File

core/tests/Drupal/KernelTests/Core/Plugin/Context/ContextAwarePluginBaseTest.php, line 124

Class

TestContextAwarePlugin

Namespace

Drupal\KernelTests\Core\Plugin\Context

Code

public function setContext($name, ComponentContextInterface $context) {
  parent::setContext($name, $context);
  $this->setContextCalled = TRUE;
}