function LocalTaskDefaultTest::testGetRouteParametersInPluginDefinitions
Same name in other branches
- 8.9.x core/tests/Drupal/Tests/Core/Menu/LocalTaskDefaultTest.php \Drupal\Tests\Core\Menu\LocalTaskDefaultTest::testGetRouteParametersInPluginDefinitions()
- 10 core/tests/Drupal/Tests/Core/Menu/LocalTaskDefaultTest.php \Drupal\Tests\Core\Menu\LocalTaskDefaultTest::testGetRouteParametersInPluginDefinitions()
- 11.x core/tests/Drupal/Tests/Core/Menu/LocalTaskDefaultTest.php \Drupal\Tests\Core\Menu\LocalTaskDefaultTest::testGetRouteParametersInPluginDefinitions()
@covers ::getRouteParameters
File
-
core/
tests/ Drupal/ Tests/ Core/ Menu/ LocalTaskDefaultTest.php, line 108
Class
- LocalTaskDefaultTest
- @coversDefaultClass \Drupal\Core\Menu\LocalTaskDefault @group Menu
Namespace
Drupal\Tests\Core\MenuCode
public function testGetRouteParametersInPluginDefinitions() {
$this->pluginDefinition = [
'route_name' => 'test_route',
'route_parameters' => [
'parameter' => 'example',
],
];
$this->routeProvider
->expects($this->once())
->method('getRouteByName')
->with('test_route')
->willReturn(new Route('/test-route/{parameter}'));
$this->setupLocalTaskDefault();
$route_match = new RouteMatch('', new Route('/'));
$this->assertEquals([
'parameter' => 'example',
], $this->localTaskBase
->getRouteParameters($route_match));
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.