You are here

protected function WebformBreadcrumbBuilderTest::getMockRouteMatch in Webform 8.5

Same name and namespace in other branches
  1. 6.x tests/src/Kernel/Breadcrumb/WebformBreadcrumbBuilderTest.php \Drupal\Tests\webform\Kernel\Breadcrumb\WebformBreadcrumbBuilderTest::getMockRouteMatch()

Get mock route match.

Parameters

string|null $route_name: (optional) A route name.

array $parameter_map: (optional) An array of parameter names and values.

Return value

\Drupal\Core\Routing\RouteMatchInterface A mocked route match.

12 calls to WebformBreadcrumbBuilderTest::getMockRouteMatch()
WebformBreadcrumbBuilderTest::testApplies in tests/src/Kernel/Breadcrumb/WebformBreadcrumbBuilderTest.php
Tests WebformBreadcrumbBuilder::applies().
WebformBreadcrumbBuilderTest::testBuildElements in tests/src/Kernel/Breadcrumb/WebformBreadcrumbBuilderTest.php
Test build element breadcrumbs.
WebformBreadcrumbBuilderTest::testBuildHandlers in tests/src/Kernel/Breadcrumb/WebformBreadcrumbBuilderTest.php
Test build handler breadcrumbs.
WebformBreadcrumbBuilderTest::testBuildSourceEntity in tests/src/Kernel/Breadcrumb/WebformBreadcrumbBuilderTest.php
Test build source entity breadcrumbs.
WebformBreadcrumbBuilderTest::testBuildSourceEntityResults in tests/src/Kernel/Breadcrumb/WebformBreadcrumbBuilderTest.php
Test build source entity submissions breadcrumbs.

... See full list

File

tests/src/Kernel/Breadcrumb/WebformBreadcrumbBuilderTest.php, line 496

Class

WebformBreadcrumbBuilderTest
Test webform breadcrumb builder.

Namespace

Drupal\Tests\webform\Kernel\Breadcrumb

Code

protected function getMockRouteMatch($route_name = NULL, array $parameter_map = []) {
  $route_match = $this
    ->createMock('Drupal\\Core\\Routing\\RouteMatchInterface');
  $route_match
    ->expects($this
    ->any())
    ->method('getRouteName')
    ->will($this
    ->returnValue($route_name));
  $route_match
    ->expects($this
    ->any())
    ->method('getParameter')
    ->will($this
    ->returnValueMap($parameter_map));

  /** @var \Drupal\Core\Routing\RouteMatchInterface $route_match */
  return $route_match;
}