You are here

protected function AccessResultTest::setUp in Drupal 8

Same name and namespace in other branches
  1. 9 core/tests/Drupal/Tests/Core/Access/AccessResultTest.php \Drupal\Tests\Core\Access\AccessResultTest::setUp()

Overrides UnitTestCase::setUp

File

core/tests/Drupal/Tests/Core/Access/AccessResultTest.php, line 37
Contains \Drupal\Tests\Core\Access\AccessResultTest.

Class

AccessResultTest
@coversDefaultClass \Drupal\Core\Access\AccessResult @group Access

Namespace

Drupal\Tests\Core\Access

Code

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