function EntityAccessCheckTest::setUp

Same name in other branches
  1. 9 core/tests/Drupal/Tests/Core/Entity/EntityAccessCheckTest.php \Drupal\Tests\Core\Entity\EntityAccessCheckTest::setUp()
  2. 8.9.x core/tests/Drupal/Tests/Core/Entity/EntityAccessCheckTest.php \Drupal\Tests\Core\Entity\EntityAccessCheckTest::setUp()
  3. 11.x core/tests/Drupal/Tests/Core/Entity/EntityAccessCheckTest.php \Drupal\Tests\Core\Entity\EntityAccessCheckTest::setUp()

Overrides UnitTestCase::setUp

File

core/tests/Drupal/Tests/Core/Entity/EntityAccessCheckTest.php, line 34

Class

EntityAccessCheckTest
Unit test of entity access checking system.

Namespace

Drupal\Tests\Core\Entity

Code

protected function setUp() : void {
    parent::setUp();
    $cache_contexts_manager = $this->prophesize(CacheContextsManager::class)
        ->reveal();
    $container = new Container();
    $container->set('cache_contexts_manager', $cache_contexts_manager);
    \Drupal::setContainer($container);
}

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