function LocalTaskManagerTest::setupFactory

Same name in other branches
  1. 9 core/tests/Drupal/Tests/Core/Menu/LocalTaskManagerTest.php \Drupal\Tests\Core\Menu\LocalTaskManagerTest::setupFactory()
  2. 10 core/tests/Drupal/Tests/Core/Menu/LocalTaskManagerTest.php \Drupal\Tests\Core\Menu\LocalTaskManagerTest::setupFactory()
  3. 11.x core/tests/Drupal/Tests/Core/Menu/LocalTaskManagerTest.php \Drupal\Tests\Core\Menu\LocalTaskManagerTest::setupFactory()

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));
}

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