You are here

public function ForumNodeBreadcrumbBuilderTest::setUp in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/forum/tests/src/Unit/Breadcrumb/ForumNodeBreadcrumbBuilderTest.php \Drupal\Tests\forum\Unit\Breadcrumb\ForumNodeBreadcrumbBuilderTest::setUp()

Overrides UnitTestCase::setUp

File

core/modules/forum/tests/src/Unit/Breadcrumb/ForumNodeBreadcrumbBuilderTest.php, line 24
Contains \Drupal\Tests\forum\Unit\Breadcrumb\ForumNodeBreadcrumbBuilderTest.

Class

ForumNodeBreadcrumbBuilderTest
@coversDefaultClass \Drupal\forum\Breadcrumb\ForumNodeBreadcrumbBuilder @group forum

Namespace

Drupal\Tests\forum\Unit\Breadcrumb

Code

public function setUp() {
  parent::setUp();
  $cache_contexts_manager = $this
    ->getMockBuilder('Drupal\\Core\\Cache\\Context\\CacheContextsManager')
    ->disableOriginalConstructor()
    ->getMock();
  $cache_contexts_manager
    ->method('assertValidTokens')
    ->willReturn(TRUE);
  $container = new Container();
  $container
    ->set('cache_contexts_manager', $cache_contexts_manager);
  \Drupal::setContainer($container);
}