You are here

class WorkflowStatesTest in Lightning Workflow 8.2

@group lightning @group lightning_workflow

Hierarchy

  • class \Drupal\Tests\lightning_workflow\ExistingSite\WorkflowStatesTest extends \weitzman\DrupalTestTraits\ExistingSiteBase

Expanded class hierarchy of WorkflowStatesTest

File

tests/src/ExistingSite/WorkflowStatesTest.php, line 12

Namespace

Drupal\Tests\lightning_workflow\ExistingSite
View source
class WorkflowStatesTest extends ExistingSiteBase {

  /**
   * Tests that workflow states look the way we expect them to.
   */
  public function test() {

    /** @var \Drupal\workflows\WorkflowInterface $workflow */
    $workflow = entity_load('workflow', 'editorial');
    $this
      ->assertInstanceOf(WorkflowInterface::class, $workflow);
    $plugin = $workflow
      ->getTypePlugin();
    $this
      ->assertSame('Send to review', $plugin
      ->getTransition('review')
      ->label());
    $this
      ->assertSame('Restore from archive', $plugin
      ->getTransition('archived_published')
      ->label());
    $this
      ->assertFalse($plugin
      ->hasTransition('archived_draft'));
    $this
      ->assertArrayHasKey('archived', $plugin
      ->getTransition('create_new_draft')
      ->from());
    $this
      ->assertSame('create_new_draft', $plugin
      ->getTransitionFromStateToState('archived', 'draft')
      ->id());
  }

}

Members

Namesort descending Modifiers Type Description Overrides
WorkflowStatesTest::test public function Tests that workflow states look the way we expect them to.