public function BreadcrumbTest::testSetLinks in Drupal 8
Same name and namespace in other branches
- 9 core/tests/Drupal/Tests/Core/Breadcrumb/BreadcrumbTest.php \Drupal\Tests\Core\Breadcrumb\BreadcrumbTest::testSetLinks()
- 10 core/tests/Drupal/Tests/Core/Breadcrumb/BreadcrumbTest.php \Drupal\Tests\Core\Breadcrumb\BreadcrumbTest::testSetLinks()
@covers ::setLinks
File
- core/
tests/ Drupal/ Tests/ Core/ Breadcrumb/ BreadcrumbTest.php, line 19
Class
- BreadcrumbTest
- @coversDefaultClass \Drupal\Core\Breadcrumb\Breadcrumb @group Breadcrumb
Namespace
Drupal\Tests\Core\BreadcrumbCode
public function testSetLinks() {
$breadcrumb = new Breadcrumb();
$breadcrumb
->setLinks([
new Link('Home', Url::fromRoute('<front>')),
]);
$this
->expectException(\LogicException::class);
$this
->expectExceptionMessage('Once breadcrumb links are set, only additional breadcrumb links can be added.');
$breadcrumb
->setLinks([
new Link('None', Url::fromRoute('<none>')),
]);
}