You are here

protected function WorkflowManagerCacheTest::setUp in State Machine 8

Overrides UnitTestCase::setUp

File

tests/src/Unit/WorkflowManagerCacheTest.php, line 75

Class

WorkflowManagerCacheTest
Tests the cache of the workflow manager.

Namespace

Drupal\Tests\state_machine\Unit

Code

protected function setUp() {
  parent::setUp();
  $this->container = $this
    ->prophesize(ContainerInterface::class);
  \Drupal::setContainer($this->container
    ->reveal());

  // Mock the dependencies to inject into the workflow manager.
  $this->moduleHandler = $this
    ->prophesize(ModuleHandlerInterface::class);
  $this->cacheBackend = $this
    ->prophesize(CacheBackendInterface::class);
  $this->workflowGroupManager = $this
    ->prophesize(WorkflowGroupManagerInterface::class);

  // Instantiate the workflow manager. This is the system under test.
  $this->workflowManager = new WorkflowManager($this->moduleHandler
    ->reveal(), $this->cacheBackend
    ->reveal(), $this->workflowGroupManager
    ->reveal());
}