class TestContextAwarePlugin

Same name in this branch
  1. 9 core/tests/Drupal/KernelTests/Core/Plugin/ContextHandlerTest.php \Drupal\KernelTests\Core\Plugin\TestContextAwarePlugin
Same name in other branches
  1. 8.9.x core/tests/Drupal/KernelTests/Core/Plugin/ContextHandlerTest.php \Drupal\KernelTests\Core\Plugin\TestContextAwarePlugin
  2. 8.9.x core/tests/Drupal/KernelTests/Core/Plugin/Context/ContextAwarePluginBaseTest.php \Drupal\KernelTests\Core\Plugin\Context\TestContextAwarePlugin
  3. 10 core/tests/Drupal/KernelTests/Core/Plugin/ContextHandlerTest.php \Drupal\KernelTests\Core\Plugin\TestContextAwarePlugin
  4. 10 core/tests/Drupal/KernelTests/Core/Plugin/Context/ContextAwarePluginTraitTest.php \Drupal\KernelTests\Core\Plugin\Context\TestContextAwarePlugin
  5. 11.x core/tests/Drupal/KernelTests/Core/Plugin/ContextHandlerTest.php \Drupal\KernelTests\Core\Plugin\TestContextAwarePlugin
  6. 11.x core/tests/Drupal/KernelTests/Core/Plugin/Context/ContextAwarePluginTraitTest.php \Drupal\KernelTests\Core\Plugin\Context\TestContextAwarePlugin

Hierarchy

Expanded class hierarchy of TestContextAwarePlugin

File

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

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

Title Sort descending Modifiers Object type Summary Member alias Overriden Title Overrides
ContextAwarePluginTrait::$context protected property The data objects representing the context of this plugin.
ContextAwarePluginTrait::$initializedContextConfig protected property Tracks whether the context has been initialized from configuration.
ContextAwarePluginTrait::getCacheContexts public function 9
ContextAwarePluginTrait::getCacheMaxAge public function 7
ContextAwarePluginTrait::getCacheTags public function 4
ContextAwarePluginTrait::getContext public function
ContextAwarePluginTrait::getContextDefinition public function
ContextAwarePluginTrait::getContextDefinitions public function
ContextAwarePluginTrait::getContextMapping public function
ContextAwarePluginTrait::getContexts public function
ContextAwarePluginTrait::getContextValue public function
ContextAwarePluginTrait::getContextValues public function
ContextAwarePluginTrait::getPluginDefinition abstract public function 1
ContextAwarePluginTrait::setContext public function Aliased as: setContextTrait 1
ContextAwarePluginTrait::setContextMapping public function
ContextAwarePluginTrait::setContextValue public function
ContextAwarePluginTrait::validateContexts public function
PluginInspectionInterface::getPluginId public function Gets the plugin_id of the plugin instance. 2
TestContextAwarePlugin::$setContextCalled public property Indicates if ::setContext() has been called or not.
TestContextAwarePlugin::setContext public function Set a context on this plugin. Overrides ContextAwarePluginInterface::setContext

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.