You are here

public function BreadcrumbManagerTest::testBuildWithoutBuilder in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 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 70
Contains \Drupal\Tests\Core\Breadcrumb\BreadcrumbManagerTest.

Class

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

Namespace

Drupal\Tests\Core\Breadcrumb

Code

public function testBuildWithoutBuilder() {
  $route_match = $this
    ->getMock('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
    ->getMock('Drupal\\Core\\Routing\\RouteMatchInterface'));
  $this
    ->assertEquals([], $breadcrumb
    ->getLinks());
  $this
    ->assertEquals([], $breadcrumb
    ->getCacheContexts());
  $this
    ->assertEquals([], $breadcrumb
    ->getCacheTags());
  $this
    ->assertEquals(Cache::PERMANENT, $breadcrumb
    ->getCacheMaxAge());
}