Same filename in this branch
- 10 core/tests/Drupal/Tests/Core/Plugin/TestPluginManager.php
- 10 core/modules/system/tests/modules/plugin_test/src/Plugin/TestPluginManager.php
Same filename and directory in other branches
- 8.9.x core/tests/Drupal/Tests/Core/Plugin/TestPluginManager.php
- 9 core/tests/Drupal/Tests/Core/Plugin/TestPluginManager.php
Namespace
Drupal\Tests\Core\Plugin
File
core/tests/Drupal/Tests/Core/Plugin/TestPluginManager.php
View source
<?php
declare (strict_types=1);
namespace Drupal\Tests\Core\Plugin;
use Drupal\Component\Plugin\Discovery\StaticDiscovery;
use Drupal\Component\Plugin\Factory\DefaultFactory;
use Drupal\Core\Extension\ModuleHandlerInterface;
use Drupal\Core\Plugin\DefaultPluginManager;
class TestPluginManager extends DefaultPluginManager {
public function __construct(\Traversable $namespaces, array $definitions, ModuleHandlerInterface $module_handler = NULL, $alter_hook = NULL, $interface = NULL) {
$this->discovery = new StaticDiscovery();
$this->factory = new DefaultFactory($this->discovery, $interface);
foreach ($definitions as $key => $definition) {
$this->discovery
->setDefinition($key, $definition);
}
$this->moduleHandler = $module_handler;
if ($alter_hook) {
$this
->alterInfo($alter_hook);
}
}
}
Classes