function PathBasedBreadcrumbBuilderTest::testBuildOnFrontpage
Same name in other branches
- 9 core/modules/system/tests/src/Unit/Breadcrumbs/PathBasedBreadcrumbBuilderTest.php \Drupal\Tests\system\Unit\Breadcrumbs\PathBasedBreadcrumbBuilderTest::testBuildOnFrontpage()
- 8.9.x core/modules/system/tests/src/Unit/Breadcrumbs/PathBasedBreadcrumbBuilderTest.php \Drupal\Tests\system\Unit\Breadcrumbs\PathBasedBreadcrumbBuilderTest::testBuildOnFrontpage()
- 10 core/modules/system/tests/src/Unit/Breadcrumbs/PathBasedBreadcrumbBuilderTest.php \Drupal\Tests\system\Unit\Breadcrumbs\PathBasedBreadcrumbBuilderTest::testBuildOnFrontpage()
Tests the build method on the frontpage.
@covers ::build
File
-
core/
modules/ system/ tests/ src/ Unit/ Breadcrumbs/ PathBasedBreadcrumbBuilderTest.php, line 144
Class
- PathBasedBreadcrumbBuilderTest
- @coversDefaultClass \Drupal\system\PathBasedBreadcrumbBuilder @group system
Namespace
Drupal\Tests\system\Unit\BreadcrumbsCode
public function testBuildOnFrontpage() : void {
$this->pathMatcher
->expects($this->once())
->method('isFrontPage')
->willReturn(TRUE);
$breadcrumb = $this->builder
->build($this->createMock('Drupal\\Core\\Routing\\RouteMatchInterface'));
$this->assertEquals([], $breadcrumb->getLinks());
$this->assertEqualsCanonicalizing([
'url.path.is_front',
'url.path.parent',
], $breadcrumb->getCacheContexts());
$this->assertEqualsCanonicalizing([], $breadcrumb->getCacheTags());
$this->assertEquals(Cache::PERMANENT, $breadcrumb->getCacheMaxAge());
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.