BreadcrumbTest.php
Same filename in this branch
Same filename in other branches
- 8.9.x core/modules/system/tests/src/Functional/Menu/BreadcrumbTest.php
- 8.9.x core/tests/Drupal/Tests/Core/Breadcrumb/BreadcrumbTest.php
- 10 core/modules/system/tests/src/Functional/Menu/BreadcrumbTest.php
- 10 core/tests/Drupal/Tests/Core/Breadcrumb/BreadcrumbTest.php
- 11.x core/modules/system/tests/src/Functional/Menu/BreadcrumbTest.php
- 11.x core/tests/Drupal/Tests/Core/Breadcrumb/BreadcrumbTest.php
Namespace
Drupal\Tests\Core\BreadcrumbFile
-
core/
tests/ Drupal/ Tests/ Core/ Breadcrumb/ BreadcrumbTest.php
View source
<?php
namespace Drupal\Tests\Core\Breadcrumb;
use Drupal\Core\Breadcrumb\Breadcrumb;
use Drupal\Core\Link;
use Drupal\Core\Url;
use Drupal\Tests\UnitTestCase;
/**
* @coversDefaultClass \Drupal\Core\Breadcrumb\Breadcrumb
* @group Breadcrumb
*/
class BreadcrumbTest extends UnitTestCase {
/**
* @covers ::setLinks
*/
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>')),
]);
}
}
Classes
Title | Deprecated | Summary |
---|---|---|
BreadcrumbTest | @coversDefaultClass \Drupal\Core\Breadcrumb\Breadcrumb @group Breadcrumb |
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.