public function PathBasedBreadcrumbBuilderTest::testBuildOnFrontpage in Zircon Profile 8
Same name and namespace in other branches
- 8.0 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 138 - Contains \Drupal\Tests\system\Unit\Breadcrumbs\PathBasedBreadcrumbBuilderTest.
Class
- PathBasedBreadcrumbBuilderTest
- @coversDefaultClass \Drupal\system\PathBasedBreadcrumbBuilder @group system
Namespace
Drupal\Tests\system\Unit\BreadcrumbsCode
public function testBuildOnFrontpage() {
$this->context
->expects($this
->once())
->method('getPathInfo')
->will($this
->returnValue('/'));
$breadcrumb = $this->builder
->build($this
->getMock('Drupal\\Core\\Routing\\RouteMatchInterface'));
$this
->assertEquals([], $breadcrumb
->getLinks());
$this
->assertEquals([
'url.path',
], $breadcrumb
->getCacheContexts());
$this
->assertEquals([], $breadcrumb
->getCacheTags());
$this
->assertEquals(Cache::PERMANENT, $breadcrumb
->getCacheMaxAge());
}