You are here

protected function EntityCreateAccessCheckTest::setUp in Drupal 8

Same name and namespace in other branches
  1. 9 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');
}