You are here

protected function AssertBreadcrumbTrait::getBreadcrumbParts in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/system/src/Tests/Menu/AssertBreadcrumbTrait.php \Drupal\system\Tests\Menu\AssertBreadcrumbTrait::getBreadcrumbParts()

Returns the breadcrumb contents of the current page in the internal browser.

1 call to AssertBreadcrumbTrait::getBreadcrumbParts()
AssertBreadcrumbTrait::assertBreadcrumbParts in core/modules/system/src/Tests/Menu/AssertBreadcrumbTrait.php
Assert that a trail exists in the internal browser.

File

core/modules/system/src/Tests/Menu/AssertBreadcrumbTrait.php, line 101
Contains \Drupal\system\Tests\Menu\AssertBreadcrumbTrait.

Class

AssertBreadcrumbTrait
Provides test assertions for verifying breadcrumbs.

Namespace

Drupal\system\Tests\Menu

Code

protected function getBreadcrumbParts() {
  $parts = array();
  $elements = $this
    ->xpath('//nav[@class="breadcrumb"]/ol/li/a');
  if (!empty($elements)) {
    foreach ($elements as $element) {
      $parts[] = array(
        'text' => (string) $element,
        'href' => (string) $element['href'],
        'title' => (string) $element['title'],
      );
    }
  }
  return $parts;
}