diff --git a/core/modules/content_moderation/tests/src/Functional/ModerationFormTest.php b/core/modules/content_moderation/tests/src/Functional/ModerationFormTest.php index b17a3cf..b7c7d21 100644 --- a/core/modules/content_moderation/tests/src/Functional/ModerationFormTest.php +++ b/core/modules/content_moderation/tests/src/Functional/ModerationFormTest.php @@ -452,9 +452,10 @@ public function testContentTranslationNodeForm() { } /** - * Tests ContentModeration::isWorkflowUsed(). + * Tests that workflows and states can not be deleted if they are in use. * * @covers \Drupal\content_moderation\Plugin\WorkflowType\ContentModeration::workflowHasData + * @covers \Drupal\content_moderation\Plugin\WorkflowType\ContentModeration::workflowStateHasData */ public function testWorkflowInUse() { $this->drupalLogin($this->rootUser); @@ -471,9 +472,11 @@ public function testWorkflowInUse() { 'title[0][value]' => 'Some moderated content', 'body[0][value]' => 'First version of the content.', ], 'Save and Create New Draft'); + // The archived state is not used yet, so can still be deleted. $this->drupalGet($paths['archived_state']); $this->assertSession()->buttonExists('Delete'); + // The workflow is being used, so can't be deleted. $this->drupalGet($paths['editorial_workflow']); $this->assertSession()->buttonNotExists('Delete'); @@ -481,7 +484,8 @@ public function testWorkflowInUse() { $node = $this->drupalGetNodeByTitle('Some moderated content'); $this->drupalPostForm('node/' . $node->id() . '/edit', [], 'Save and Publish'); $this->drupalPostForm('node/' . $node->id() . '/edit', [], 'Save and Archive'); - // Now the archived state is being used it can't be deleted either. + + // Now the archived state is being used so it can not be deleted either. foreach ($paths as $path) { $this->drupalGet($path); $this->assertSession()->buttonNotExists('Delete');