You are here

public function BreadcrumbTest::testSetLinks in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/tests/Drupal/Tests/Core/Breadcrumb/BreadcrumbTest.php \Drupal\Tests\Core\Breadcrumb\BreadcrumbTest::testSetLinks()

@covers ::setLinks @expectedException \LogicException @expectedExceptionMessage Once breadcrumb links are set, only additional breadcrumb links can be added.

File

core/tests/Drupal/Tests/Core/Breadcrumb/BreadcrumbTest.php, line 26
Contains \Drupal\Tests\Core\Breadcrumb\BreadcrumbTest.

Class

BreadcrumbTest
@coversDefaultClass \Drupal\Core\Breadcrumb\Breadcrumb @group Breadcrumb

Namespace

Drupal\Tests\Core\Breadcrumb

Code

public function testSetLinks() {
  $breadcrumb = new Breadcrumb();
  $breadcrumb
    ->setLinks([
    new Link('Home', Url::fromRoute('<front>')),
  ]);
  $breadcrumb
    ->setLinks([
    new Link('None', Url::fromRoute('<none>')),
  ]);
}