function ContentTranslationManageAccessCheckTest::setUp

Same name in other branches
  1. 9 core/modules/content_translation/tests/src/Unit/Access/ContentTranslationManageAccessCheckTest.php \Drupal\Tests\content_translation\Unit\Access\ContentTranslationManageAccessCheckTest::setUp()
  2. 10 core/modules/content_translation/tests/src/Unit/Access/ContentTranslationManageAccessCheckTest.php \Drupal\Tests\content_translation\Unit\Access\ContentTranslationManageAccessCheckTest::setUp()
  3. 11.x core/modules/content_translation/tests/src/Unit/Access/ContentTranslationManageAccessCheckTest.php \Drupal\Tests\content_translation\Unit\Access\ContentTranslationManageAccessCheckTest::setUp()

Overrides UnitTestCase::setUp

File

core/modules/content_translation/tests/src/Unit/Access/ContentTranslationManageAccessCheckTest.php, line 33

Class

ContentTranslationManageAccessCheckTest
Tests for content translation manage check.

Namespace

Drupal\Tests\content_translation\Unit\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);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.