You are here

public function ScheduledTransitionsEntityHooksUnitTest::__construct in Scheduled Transitions 8

Same name and namespace in other branches
  1. 2.x tests/src/Unit/ScheduledTransitionsEntityHooksUnitTest.php \Drupal\Tests\scheduled_transitions\Unit\ScheduledTransitionsEntityHooksUnitTest::__construct()

ScheduledTransitionsEntityHooksUnitTest constructor.

File

tests/src/Unit/ScheduledTransitionsEntityHooksUnitTest.php, line 55

Class

ScheduledTransitionsEntityHooksUnitTest
Tests entity hooks.

Namespace

Drupal\Tests\scheduled_transitions\Unit

Code

public function __construct() {
  parent::__construct();
  $this->testConfigFactory = $this
    ->createMock(ConfigFactoryInterface::class);
  $this->testEntityTypeManager = $this
    ->createMock(EntityTypeManagerInterface::class);
  $this->testModerationInformation = $this
    ->createMock(ModerationInformationInterface::class);
  $cacheContextsManager = $this
    ->getMockBuilder(CacheContextsManager::class)
    ->disableOriginalConstructor()
    ->getMock();
  $cacheContextsManager
    ->method('assertValidTokens')
    ->willReturn(TRUE);
  $container = new ContainerBuilder();
  $container
    ->set('cache_contexts_manager', $cacheContextsManager);
  $this->testContainer = $container;
}