function AccessPolicyProcessorTest::setUp

Same name in other branches
  1. 11.x core/tests/Drupal/Tests/Core/Session/AccessPolicyProcessorTest.php \Drupal\Tests\Core\Session\AccessPolicyProcessorTest::setUp()

Overrides UnitTestCase::setUp

File

core/tests/Drupal/Tests/Core/Session/AccessPolicyProcessorTest.php, line 37

Class

AccessPolicyProcessorTest
Tests the AccessPolicyProcessor service.

Namespace

Drupal\Tests\Core\Session

Code

public function setUp() : void {
    parent::setUp();
    $cache_context_manager = $this->prophesize(CacheContextsManager::class);
    $cache_context_manager->assertValidTokens(Argument::any())
        ->willReturn(TRUE);
    $container = $this->prophesize(ContainerInterface::class);
    $container->get('cache_contexts_manager')
        ->willReturn($cache_context_manager->reveal());
    \Drupal::setContainer($container->reveal());
}

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