function CategorizingPluginManagerTraitTest::setUp

Same name in other branches
  1. 9 core/tests/Drupal/Tests/Core/Plugin/CategorizingPluginManagerTraitTest.php \Drupal\Tests\Core\Plugin\CategorizingPluginManagerTraitTest::setUp()
  2. 10 core/tests/Drupal/Tests/Core/Plugin/CategorizingPluginManagerTraitTest.php \Drupal\Tests\Core\Plugin\CategorizingPluginManagerTraitTest::setUp()
  3. 11.x 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

Namespace

Drupal\Tests\Core\Plugin

Code

protected function setUp() {
    $module_handler = $this->createMock('Drupal\\Core\\Extension\\ModuleHandlerInterface');
    $module_handler->expects($this->any())
        ->method('getModuleList')
        ->willReturn([
        'node' => [],
    ]);
    $module_handler->expects($this->any())
        ->method('getName')
        ->with('node')
        ->willReturn('Node');
    $this->pluginManager = new CategorizingPluginManager($module_handler);
    $this->pluginManager
        ->setStringTranslation($this->getStringTranslationStub());
}

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