You are here

private function NavigationalStructureTest::assertBreadcrumbsVisible in Entity Construction Kit (ECK) 8

Asserts that the given breadcrumbs are visible.

Parameters

string[] $expectedBreadcrumbs: The expected breadcrumbs.

1 call to NavigationalStructureTest::assertBreadcrumbsVisible()
NavigationalStructureTest::assertCorrectPageOnRoute in tests/src/Functional/NavigationalStructureTest.php
Asserts that the page on a given route contains all the elements we expect.

File

tests/src/Functional/NavigationalStructureTest.php, line 148

Class

NavigationalStructureTest
Test Entity Construction Kit's navigational structure.

Namespace

Drupal\Tests\eck\Functional

Code

private function assertBreadcrumbsVisible(array $expectedBreadcrumbs) {
  $breadcrumbs = $this
    ->getSession()
    ->getPage()
    ->findAll('css', '.breadcrumb a');
  $actualCrumbs = [];
  do {
    $actualCrumbs[] = array_shift($breadcrumbs)
      ->getText();
  } while (!empty($breadcrumbs));
  self::assertEquals($expectedBreadcrumbs, $actualCrumbs);
}