class TestFilteredPluginManager
Same name and namespace in other branches
- 10 core/tests/Drupal/Tests/Core/Plugin/FilteredPluginManagerTraitTest.php \Drupal\Tests\Core\Plugin\TestFilteredPluginManager
- 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
- main 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 implements \Drupal\Core\Plugin\FilteredPluginManagerInterface uses \Drupal\Core\Plugin\FilteredPluginManagerTrait extends \Drupal\Component\Plugin\PluginManagerBase
Expanded class hierarchy of TestFilteredPluginManager
File
-
core/
tests/ Drupal/ Tests/ Core/ Plugin/ FilteredPluginManagerTraitTest.php, line 88
Namespace
Drupal\Tests\Core\PluginView source
class TestFilteredPluginManager extends PluginManagerBase implements FilteredPluginManagerInterface {
use FilteredPluginManagerTrait;
/**
* An array of plugin definitions.
*
* @var array
*/
protected $definitions = [];
/**
* The module handler.
*
* @var \Drupal\Core\Extension\ModuleHandlerInterface
*/
protected $moduleHandler;
/**
* The theme manager.
*
* @var \Drupal\Core\Theme\ThemeManagerInterface
*/
protected $themeManager;
/**
* The context handler.
*
* @var \Drupal\Core\Plugin\Context\ContextHandlerInterface
*/
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
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.