You are here

protected function BreadcrumbManagerTest::setUp 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::setUp()

Overrides UnitTestCase::setUp

File

core/tests/Drupal/Tests/Core/Breadcrumb/BreadcrumbManagerTest.php, line 54
Contains \Drupal\Tests\Core\Breadcrumb\BreadcrumbManagerTest.

Class

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

Namespace

Drupal\Tests\Core\Breadcrumb

Code

protected function setUp() {
  $this->moduleHandler = $this
    ->getMock('Drupal\\Core\\Extension\\ModuleHandlerInterface');
  $this->breadcrumbManager = new BreadcrumbManager($this->moduleHandler);
  $this->breadcrumb = new Breadcrumb();
  $this->container = new ContainerBuilder();
  $cache_contexts_manager = $this
    ->prophesize(CacheContextsManager::class);
  $cache_contexts_manager
    ->assertValidTokens()
    ->willReturn(TRUE);
  $cache_contexts_manager
    ->reveal();
  $this->container
    ->set('cache_contexts_manager', $cache_contexts_manager);
  \Drupal::setContainer($this->container);
}