You are here

protected function LocalTaskManagerTest::setupFactory in Drupal 8

Setups the plugin factory with some local task plugins.

Parameters

\PHPUnit\Framework\MockObject\MockObject $mock_plugin: The mock plugin.

4 calls to LocalTaskManagerTest::setupFactory()
LocalTaskManagerTest::testGetLocalTaskForRouteWithEmptyCache in core/tests/Drupal/Tests/Core/Menu/LocalTaskManagerTest.php
Tests the cache of the local task manager with an empty initial cache.
LocalTaskManagerTest::testGetLocalTaskForRouteWithFilledCache in core/tests/Drupal/Tests/Core/Menu/LocalTaskManagerTest.php
Tests the cache of the local task manager with a filled initial cache.
LocalTaskManagerTest::testGetLocalTasksForRouteForChild in core/tests/Drupal/Tests/Core/Menu/LocalTaskManagerTest.php
Tests the getLocalTasksForRoute method on a child.
LocalTaskManagerTest::testGetLocalTasksForRouteSingleLevelTitle in core/tests/Drupal/Tests/Core/Menu/LocalTaskManagerTest.php
Tests the getLocalTasksForRoute method.

File

core/tests/Drupal/Tests/Core/Menu/LocalTaskManagerTest.php, line 362

Class

LocalTaskManagerTest
@coversDefaultClass \Drupal\Core\Menu\LocalTaskManager @group Menu

Namespace

Drupal\Tests\Core\Menu

Code

protected function setupFactory($mock_plugin) {
  $map = [];
  foreach ($this
    ->getLocalTaskFixtures() as $info) {
    $map[] = [
      $info['id'],
      [],
      $mock_plugin,
    ];
  }
  $this->factory
    ->expects($this
    ->any())
    ->method('createInstance')
    ->will($this
    ->returnValueMap($map));
}