diff --git a/core/modules/content_moderation/tests/src/Kernel/EntityStateChangeValidationTest.php b/core/modules/content_moderation/tests/src/Kernel/EntityStateChangeValidationTest.php index c8ce61b565..97404a85d8 100644 --- a/core/modules/content_moderation/tests/src/Kernel/EntityStateChangeValidationTest.php +++ b/core/modules/content_moderation/tests/src/Kernel/EntityStateChangeValidationTest.php @@ -149,14 +149,6 @@ public function testInvalidStateWithoutExisting() { // Assign the node to a state we're going to delete. $node->moderation_state->value = 'deleted_state'; $node->save(); - - // Delete the state so $node->original contains an invalid state when - // validating. - $workflow->deleteState('deleted_state'); - $workflow->save(); - $node->moderation_state->value = 'draft'; - $violations = $node->validate(); - $this->assertCount(0, $violations); } /** diff --git a/core/modules/workflows/tests/src/Unit/WorkflowTest.php b/core/modules/workflows/tests/src/Unit/WorkflowTest.php index 51cb912070..15a7985418 100644 --- a/core/modules/workflows/tests/src/Unit/WorkflowTest.php +++ b/core/modules/workflows/tests/src/Unit/WorkflowTest.php @@ -238,6 +238,7 @@ public function testDeleteState() { ->addTransition('create_new_draft', 'Create new draft', ['draft', 'published'], 'draft'); $this->assertCount(2, $workflow->getStates()); $this->assertCount(2, $workflow->getState('published')->getTransitions()); + $workflow_type->workflowStateHasData($workflow, $workflow->getState('draft'))->willReturn(FALSE); $workflow->deleteState('draft'); $this->assertFalse($workflow->hasState('draft')); $this->assertCount(1, $workflow->getStates());