You are here

public function InstallTest::testWorkflowExists in Lightning Workflow 8.3

Tests that a pre-existing editorial workflow is preserved.

File

tests/src/Functional/InstallTest.php, line 37

Class

InstallTest
Tests that our configuration is correctly installed in various contexts.

Namespace

Drupal\Tests\lightning_workflow\Functional

Code

public function testWorkflowExists() {
  Workflow::create([
    'id' => 'editorial',
    'label' => 'Editorial',
    'type' => 'content_moderation',
  ])
    ->save();
  $this->container
    ->get('module_installer')
    ->install([
    'lightning_workflow',
  ]);

  /** @var \Drupal\workflows\WorkflowInterface $workflow */
  $workflow = Workflow::load('editorial');
  $this
    ->assertFalse($workflow
    ->getTypePlugin()
    ->hasState('review'));
}