You are here

protected function CategorizingPluginManagerTraitTest::setUp in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 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
Contains \Drupal\Tests\Core\Plugin\CategorizingPluginManagerTraitTest.

Class

CategorizingPluginManagerTraitTest
@coversDefaultClass \Drupal\Core\Plugin\CategorizingPluginManagerTrait @group Plugin

Namespace

Drupal\Tests\Core\Plugin

Code

protected function setUp() {
  $module_handler = $this
    ->getMock('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());
}