You are here

public function WebformBreadcrumbBuilderTest::testBuildSourceEntity 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::testBuildSourceEntity()

Test build source entity breadcrumbs.

File

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

Class

WebformBreadcrumbBuilderTest
Test webform breadcrumb builder.

Namespace

Drupal\Tests\webform\Kernel\Breadcrumb

Code

public function testBuildSourceEntity() {
  $this
    ->setSourceEntity($this->nodeAccess);
  $route_match = $this
    ->getMockRouteMatch('entity.node.webform', [
    [
      'webform',
      $this->webformAccess,
    ],
    [
      'node',
      $this->nodeAccess,
    ],
  ]);
  $links = [
    Link::createFromRoute('Home', '<front>'),
    $this->node
      ->toLink(),
  ];
  $this
    ->assertLinks($route_match, $links);
}