You are here

protected function EntityCreateAccessCheckTest::setUp in Drupal 10

Same name and namespace in other branches
  1. 8 core/tests/Drupal/Tests/Core/Entity/EntityCreateAccessCheckTest.php \Drupal\Tests\Core\Entity\EntityCreateAccessCheckTest::setUp()
  2. 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() : void {
  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');
}