Same name and namespace in other branches
- 8.9.x core/tests/Drupal/Tests/Core/Plugin/CategorizingPluginManagerTraitTest.php \Drupal\Tests\Core\Plugin\CategorizingPluginManagerTraitTest::setUp()
- 9 core/tests/Drupal/Tests/Core/Plugin/CategorizingPluginManagerTraitTest.php \Drupal\Tests\Core\Plugin\CategorizingPluginManagerTraitTest::setUp()
Overrides UnitTestCase::setUp
File
- core/
tests/ Drupal/ Tests/ Core/ Plugin/ CategorizingPluginManagerTraitTest.php, line 32
Class
- CategorizingPluginManagerTraitTest
- @coversDefaultClass \Drupal\Core\Plugin\CategorizingPluginManagerTrait @group Plugin @runTestsInSeparateProcesses
Namespace
Drupal\Tests\Core\PluginCode
protected function setUp() : void {
parent::setUp();
$module_handler = $this
->createMock('Drupal\\Core\\Extension\\ModuleHandlerInterface');
$module_handler
->expects($this
->any())
->method('getModuleList')
->willReturn([
'node' => [],
]);
$module_extension_list = $this
->createMock(ModuleExtensionList::class);
$module_extension_list
->expects($this
->any())
->method('getName')
->willReturnCallback(function ($argument) {
if ($argument == 'node') {
return 'Node';
}
throw new UnknownExtensionException();
});
$this->pluginManager = new CategorizingPluginManager($module_handler, $module_extension_list);
$this->pluginManager
->setStringTranslation($this
->getStringTranslationStub());
}