function ShortcutLocalTasksTest::setUp
Overrides LocalTaskIntegrationTestBase::setUp
File
- 
              core/
modules/ shortcut/ tests/ src/ Unit/ Menu/ ShortcutLocalTasksTest.php, line 20  
Class
- ShortcutLocalTasksTest
 - Tests existence of shortcut local tasks.
 
Namespace
Drupal\Tests\shortcut\Unit\MenuCode
protected function setUp() : void {
  $this->directoryList = [
    'shortcut' => 'core/modules/shortcut',
    'user' => 'core/modules/user',
  ];
  parent::setUp();
  // Add services required for user local tasks.
  $entity_type_manager = $this->createMock(EntityTypeManagerInterface::class);
  $entity_type_manager->expects($this->any())
    ->method('getDefinitions')
    ->willReturn([]);
  $this->container
    ->set('entity_type.manager', $entity_type_manager);
  $this->container
    ->set('string_translation', $this->getStringTranslationStub());
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.