You are here

public function BreadcrumbManagerTest::testBuildWithoutBuilder in Drupal 8

Same name and namespace in other branches
  1. 9 core/tests/Drupal/Tests/Core/Breadcrumb/BreadcrumbManagerTest.php \Drupal\Tests\Core\Breadcrumb\BreadcrumbManagerTest::testBuildWithoutBuilder()
  2. 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 65

Class

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

Namespace

Drupal\Tests\Core\Breadcrumb

Code

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());
}