Same filename in this branch
- 10 core/tests/Drupal/Tests/Core/Breadcrumb/BreadcrumbTest.php
- 10 core/modules/system/tests/src/Functional/Menu/BreadcrumbTest.php
Same filename and directory in other branches
- 8.9.x core/tests/Drupal/Tests/Core/Breadcrumb/BreadcrumbTest.php
- 9 core/tests/Drupal/Tests/Core/Breadcrumb/BreadcrumbTest.php
Namespace
Drupal\Tests\Core\Breadcrumb
File
core/tests/Drupal/Tests/Core/Breadcrumb/BreadcrumbTest.php
View source
<?php
declare (strict_types=1);
namespace Drupal\Tests\Core\Breadcrumb;
use Drupal\Core\Breadcrumb\Breadcrumb;
use Drupal\Core\Link;
use Drupal\Core\Url;
use Drupal\Tests\UnitTestCase;
class BreadcrumbTest extends UnitTestCase {
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