diff --git a/core/modules/workflows/tests/src/Functional/WorkflowUiTest.php b/core/modules/workflows/tests/src/Functional/WorkflowUiTest.php index 4fba1c8..5f956bf 100644 --- a/core/modules/workflows/tests/src/Functional/WorkflowUiTest.php +++ b/core/modules/workflows/tests/src/Functional/WorkflowUiTest.php @@ -167,6 +167,7 @@ public function testWorkflowCreation() { $this->clickLink('Add a new state'); $this->submitForm(['label' => 'ToTestState', 'id' => 'toteststate'], 'Save'); $this->assertSession()->pageTextContains('Created ToTestState state.'); + // Create a new transition to test changing the transition 'to' value. $this->drupalGet('admin/config/workflow/workflows/manage/test'); $this->clickLink('Add a new transition'); @@ -174,6 +175,7 @@ public function testWorkflowCreation() { $this->assertSession()->pageTextContains('Created ToTestTransition transition.'); $workflow = $workflow_storage->loadUnchanged('test'); $this->assertTrue($workflow->getState('toteststate')->canTransitionTo('draft'), 'Can transition from toteststate to draft'); + // Edit the new transition to test changing the transition 'to' value. $this->drupalGet('admin/config/workflow/workflows/manage/test/transition/totesttransition'); $this->assertSession()->pageTextContains('ToTestTransition'); @@ -181,17 +183,20 @@ public function testWorkflowCreation() { $workflow = $workflow_storage->loadUnchanged('test'); $this->assertTrue($workflow->getState('toteststate')->canTransitionTo('published'), 'Can transition from toteststate to published'); $this->assertFalse($workflow->getState('toteststate')->canTransitionTo('draft'), 'Can no longer transition from toteststate to draft'); + // Create another new transition to help test that we cannot create a // duplicate by changing the 'to' value. $this->drupalGet('admin/config/workflow/workflows/manage/test'); $this->clickLink('Add a new transition'); $this->submitForm(['id' => 'totesttransitionduplicate', 'label' => 'ToTestTransitionDuplicate', 'from[toteststate]' => 'toteststate', 'to' => 'draft'], 'Save'); $this->assertSession()->pageTextContains('Created ToTestTransitionDuplicate transition.'); + // Ensure that we cannot create a duplicate by changing the 'to' value. $this->drupalGet('admin/config/workflow/workflows/manage/test/transition/totesttransitionduplicate'); $this->assertSession()->pageTextContains('ToTestTransitionDuplicate'); $this->submitForm(['from[toteststate]' => 'toteststate', 'to' => 'published'], 'Save'); $this->assertSession()->pageTextContains('The transition from ToTestState to Live already exists.'); + // Delete transitions used in test changing the transition 'to' value. $this->drupalGet('admin/config/workflow/workflows/manage/test/transition/totesttransition'); $this->clickLink('Delete'); @@ -199,6 +204,7 @@ public function testWorkflowCreation() { $this->drupalGet('admin/config/workflow/workflows/manage/test/transition/totesttransitionduplicate'); $this->clickLink('Delete'); $this->submitForm([], 'Delete'); + // Delete state use in test changing the transition 'to' value. $this->drupalGet('admin/config/workflow/workflows/manage/test/state/toteststate'); $this->clickLink('Delete');