function SuperUserAccessPolicyTest::setUp
Overrides UnitTestCase::setUp
File
- 
              core/
tests/ Drupal/ Tests/ Core/ Session/ SuperUserAccessPolicyTest.php, line 38  
Class
Namespace
Drupal\Tests\Core\SessionCode
protected function setUp() : void {
  parent::setUp();
  $this->accessPolicy = new SuperUserAccessPolicy();
  $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.