public function PathBasedBreadcrumbBuilderTest::testBuildWithNonProcessedPath 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::testBuildWithNonProcessedPath()
Tests the build method with a non processed path.
@covers ::build @covers ::getRequestForPath
File
- core/
modules/ system/ tests/ src/ Unit/ Breadcrumbs/ PathBasedBreadcrumbBuilderTest.php, line 302 - Contains \Drupal\Tests\system\Unit\Breadcrumbs\PathBasedBreadcrumbBuilderTest.
Class
- PathBasedBreadcrumbBuilderTest
- @coversDefaultClass \Drupal\system\PathBasedBreadcrumbBuilder @group system
Namespace
Drupal\Tests\system\Unit\BreadcrumbsCode
public function testBuildWithNonProcessedPath() {
$this->context
->expects($this
->once())
->method('getPathInfo')
->will($this
->returnValue('/example/bar'));
$this->pathProcessor
->expects($this
->once())
->method('processInbound')
->will($this
->returnValue(FALSE));
$this->requestMatcher
->expects($this
->any())
->method('matchRequest')
->will($this
->returnValue(array()));
$breadcrumb = $this->builder
->build($this
->getMock('Drupal\\Core\\Routing\\RouteMatchInterface'));
// No path matched, though at least the frontpage is displayed.
$this
->assertEquals([
0 => new Link('Home', new Url('<front>')),
], $breadcrumb
->getLinks());
$this
->assertEquals([
'url.path',
], $breadcrumb
->getCacheContexts());
$this
->assertEquals([], $breadcrumb
->getCacheTags());
$this
->assertEquals(Cache::PERMANENT, $breadcrumb
->getCacheMaxAge());
}