function EntityCreateAccessCheckTest::setUp

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

Overrides UnitTestCase::setUp

File

core/tests/Drupal/Tests/Core/Entity/EntityCreateAccessCheckTest.php, line 30

Class

EntityCreateAccessCheckTest
@coversDefaultClass \Drupal\Core\Entity\EntityCreateAccessCheck

Namespace

Drupal\Tests\Core\Entity

Code

protected function setUp() {
    parent::setUp();
    $cache_contexts_manager = $this->prophesize(CacheContextsManager::class);
    $cache_contexts_manager->assertValidTokens()
        ->willReturn(TRUE);
    $cache_contexts_manager->reveal();
    $container = new Container();
    $container->set('cache_contexts_manager', $cache_contexts_manager);
    \Drupal::setContainer($container);
    $this->entityTypeManager = $this->createMock('Drupal\\Core\\Entity\\EntityTypeManagerInterface');
}

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