public function BreadcrumbManagerTest::testBuildWithoutBuilder in Drupal 10
Same name and namespace in other branches
- 8 core/tests/Drupal/Tests/Core/Breadcrumb/BreadcrumbManagerTest.php \Drupal\Tests\Core\Breadcrumb\BreadcrumbManagerTest::testBuildWithoutBuilder()
- 9 core/tests/Drupal/Tests/Core/Breadcrumb/BreadcrumbManagerTest.php \Drupal\Tests\Core\Breadcrumb\BreadcrumbManagerTest::testBuildWithoutBuilder()
Tests the breadcrumb manager without any set breadcrumb.
File
- core/
tests/ Drupal/ Tests/ Core/ Breadcrumb/ BreadcrumbManagerTest.php, line 65
Class
- BreadcrumbManagerTest
- @coversDefaultClass \Drupal\Core\Breadcrumb\BreadcrumbManager @group Breadcrumb
Namespace
Drupal\Tests\Core\BreadcrumbCode
public function testBuildWithoutBuilder() {
$route_match = $this
->createMock('Drupal\\Core\\Routing\\RouteMatchInterface');
$this->moduleHandler
->expects($this
->once())
->method('alter')
->with('system_breadcrumb', $this->breadcrumb, $route_match, [
'builder' => NULL,
]);
$breadcrumb = $this->breadcrumbManager
->build($this
->createMock('Drupal\\Core\\Routing\\RouteMatchInterface'));
$this
->assertEquals([], $breadcrumb
->getLinks());
$this
->assertEquals([], $breadcrumb
->getCacheContexts());
$this
->assertEquals([], $breadcrumb
->getCacheTags());
$this
->assertEquals(Cache::PERMANENT, $breadcrumb
->getCacheMaxAge());
}