function BreadcrumbManagerTest::testBuildWithoutBuilder

Same name in other branches
  1. 9 core/tests/Drupal/Tests/Core/Breadcrumb/BreadcrumbManagerTest.php \Drupal\Tests\Core\Breadcrumb\BreadcrumbManagerTest::testBuildWithoutBuilder()
  2. 8.9.x core/tests/Drupal/Tests/Core/Breadcrumb/BreadcrumbManagerTest.php \Drupal\Tests\Core\Breadcrumb\BreadcrumbManagerTest::testBuildWithoutBuilder()
  3. 10 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 69

Class

BreadcrumbManagerTest
@coversDefaultClass \Drupal\Core\Breadcrumb\BreadcrumbManager @group Breadcrumb

Namespace

Drupal\Tests\Core\Breadcrumb

Code

public function testBuildWithoutBuilder() : void {
    $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());
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.