class TestFilteredPluginManager
Same name in other branches
- 9 core/tests/Drupal/Tests/Core/Plugin/FilteredPluginManagerTraitTest.php \Drupal\Tests\Core\Plugin\TestFilteredPluginManager
- 8.9.x core/tests/Drupal/Tests/Core/Plugin/FilteredPluginManagerTraitTest.php \Drupal\Tests\Core\Plugin\TestFilteredPluginManager
- 10 core/tests/Drupal/Tests/Core/Plugin/FilteredPluginManagerTraitTest.php \Drupal\Tests\Core\Plugin\TestFilteredPluginManager
Class that allows testing the trait.
Hierarchy
- class \Drupal\Component\Plugin\PluginManagerBase implements \Drupal\Component\Plugin\PluginManagerInterface uses \Drupal\Component\Plugin\Discovery\DiscoveryTrait
- class \Drupal\Tests\Core\Plugin\TestFilteredPluginManager extends \Drupal\Component\Plugin\PluginManagerBase implements \Drupal\Core\Plugin\FilteredPluginManagerInterface uses \Drupal\Core\Plugin\FilteredPluginManagerTrait
Expanded class hierarchy of TestFilteredPluginManager
File
-
core/
tests/ Drupal/ Tests/ Core/ Plugin/ FilteredPluginManagerTraitTest.php, line 84
Namespace
Drupal\Tests\Core\PluginView source
class TestFilteredPluginManager extends PluginManagerBase implements FilteredPluginManagerInterface {
use FilteredPluginManagerTrait;
protected $definitions = [];
protected $moduleHandler;
protected $themeManager;
protected $contextHandler;
public function __construct(array $definitions, ModuleHandlerInterface $module_handler, ThemeManagerInterface $theme_manager, ContextHandlerInterface $context_handler) {
$this->definitions = $definitions;
$this->moduleHandler = $module_handler;
$this->themeManager = $theme_manager;
$this->contextHandler = $context_handler;
}
protected function contextHandler() {
return $this->contextHandler;
}
protected function moduleHandler() {
return $this->moduleHandler;
}
protected function themeManager() {
return $this->themeManager;
}
protected function getType() : string {
return 'the_type';
}
public function getDefinitions() {
return $this->definitions;
}
}
Members
Title Sort descending | Modifiers | Object type | Summary | Overriden Title | Overrides |
---|---|---|---|---|---|
ContextAwarePluginManagerTrait::getDefinitionsForContexts | public | function | See \Drupal\Core\Plugin\Context\ContextAwarePluginManagerInterface::getDefinitionsForContexts(). | ||
DiscoveryTrait::doGetDefinition | protected | function | Gets a specific plugin definition. | ||
DiscoveryTrait::hasDefinition | public | function | |||
FilteredPluginManagerTrait::getFilteredDefinitions | public | function | Implements \Drupal\Core\Plugin\FilteredPluginManagerInterface::getFilteredDefinitions(). | ||
PluginManagerBase::$discovery | protected | property | The object that discovers plugins managed by this manager. | ||
PluginManagerBase::$factory | protected | property | The object that instantiates plugins managed by this manager. | ||
PluginManagerBase::$mapper | protected | property | The object that returns the preconfigured plugin instance appropriate for a particular runtime condition. | ||
PluginManagerBase::createInstance | public | function | 15 | ||
PluginManagerBase::getDefinition | public | function | Overrides DiscoveryTrait::getDefinition | ||
PluginManagerBase::getDiscovery | protected | function | Gets the plugin discovery. | 1 | |
PluginManagerBase::getFactory | protected | function | Gets the plugin factory. | 1 | |
PluginManagerBase::getFallbackPluginId | protected | function | Gets a fallback id for a missing plugin. | 6 | |
PluginManagerBase::getInstance | public | function | 6 | ||
PluginManagerBase::handlePluginNotFound | protected | function | Allows plugin managers to specify custom behavior if a plugin is not found. | 1 | |
TestFilteredPluginManager::$contextHandler | protected | property | |||
TestFilteredPluginManager::$definitions | protected | property | |||
TestFilteredPluginManager::$moduleHandler | protected | property | |||
TestFilteredPluginManager::$themeManager | protected | property | |||
TestFilteredPluginManager::contextHandler | protected | function | Overrides ContextAwarePluginManagerTrait::contextHandler | ||
TestFilteredPluginManager::getDefinitions | public | function | Overrides ContextAwarePluginManagerTrait::getDefinitions | ||
TestFilteredPluginManager::getType | protected | function | Overrides FilteredPluginManagerTrait::getType | ||
TestFilteredPluginManager::moduleHandler | protected | function | Overrides FilteredPluginManagerTrait::moduleHandler | ||
TestFilteredPluginManager::themeManager | protected | function | Overrides FilteredPluginManagerTrait::themeManager | ||
TestFilteredPluginManager::__construct | public | function |
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.