You are here

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

Test build element breadcrumbs.

File

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

Class

WebformBreadcrumbBuilderTest
Test webform breadcrumb builder.

Namespace

Drupal\Tests\webform\Kernel\Breadcrumb

Code

public function testBuildElements() {
  $route_match = $this
    ->getMockRouteMatch('entity.webform_ui.element', [
    [
      'webform',
      $this->webform,
    ],
  ]);
  $links = [
    Link::createFromRoute('Home', '<front>'),
    Link::createFromRoute('Administration', 'system.admin'),
    Link::createFromRoute('Structure', 'system.admin_structure'),
    Link::createFromRoute('Webforms', 'entity.webform.collection'),
    Link::createFromRoute($this->webform
      ->label(), 'entity.webform.canonical', [
      'webform' => $this->webform
        ->id(),
    ]),
    Link::createFromRoute('Elements', 'entity.webform.edit_form', [
      'webform' => $this->webform
        ->id(),
    ]),
  ];
  $this
    ->assertLinks($route_match, $links);
}