You are here

protected function WorkbenchTransitionEmailTest::getSubmitButtonTitleForTransition in Workbench Email 8

Same name and namespace in other branches
  1. 2.x tests/src/Functional/WorkbenchTransitionEmailTest.php \Drupal\Tests\workbench_email\Functional\WorkbenchTransitionEmailTest::getSubmitButtonTitleForTransition()

Get submit button title text for transition.

Return value

string Button title.

Overrides WorkbenchEmailTestBase::getSubmitButtonTitleForTransition

File

tests/src/Functional/WorkbenchTransitionEmailTest.php, line 109

Class

WorkbenchTransitionEmailTest
Tests the view access control handler for moderation state entities.

Namespace

Drupal\Tests\workbench_email\Functional

Code

protected function getSubmitButtonTitleForTransition($from_state, $to_state) {
  if ($from_state === 'published' && $to_state === 'draft') {
    return 'Create New Draft';
  }
  if ($from_state === 'draft' && $to_state === 'draft') {
    return 'Save and Create New Draft';
  }
  if ($from_state === 'draft' && $to_state === 'needs_review') {
    return 'Save and Request Review';
  }
  return 'Save and Publish';
}