function LocalTaskDefaultTest::testGetRouteParametersForStaticRoute

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

@covers ::getRouteParameters

File

core/tests/Drupal/Tests/Core/Menu/LocalTaskDefaultTest.php, line 89

Class

LocalTaskDefaultTest
@coversDefaultClass \Drupal\Core\Menu\LocalTaskDefault @group Menu

Namespace

Drupal\Tests\Core\Menu

Code

public function testGetRouteParametersForStaticRoute() {
    $this->pluginDefinition = [
        'route_name' => 'test_route',
    ];
    $this->routeProvider
        ->expects($this->once())
        ->method('getRouteByName')
        ->with('test_route')
        ->willReturn(new Route('/test-route'));
    $this->setupLocalTaskDefault();
    $route_match = new RouteMatch('', new Route('/'));
    $this->assertEquals([], $this->localTaskBase
        ->getRouteParameters($route_match));
}

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