You are here

public function WebformBreadcrumbBuilderTest::testBuildSourceEntitySubmissions in Webform 6.x

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

Test build source entity submissions breadcrumbs.

File

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

Class

WebformBreadcrumbBuilderTest
Test webform breadcrumb builder.

Namespace

Drupal\Tests\webform\Kernel\Breadcrumb

Code

public function testBuildSourceEntitySubmissions() {
  $this
    ->setSourceEntity($this->nodeAccess);
  $route_match = $this
    ->getMockRouteMatch('entity.node.webform.user.submission', [
    [
      'webform_submission',
      $this->webformSubmissionAccess,
    ],
    [
      'webform',
      $this->webform,
    ],
    [
      'node',
      $this->node,
    ],
  ]);
  $links = [
    Link::createFromRoute('Home', '<front>'),
    $this->node
      ->toLink(),
    Link::createFromRoute('Submissions', 'entity.node.webform.user.submissions', [
      'node' => 1,
    ]),
  ];
  $this
    ->assertLinks($route_match, $links);
}