diff --git a/core/modules/workflows/src/Plugin/WorkflowTypeBase.php b/core/modules/workflows/src/Plugin/WorkflowTypeBase.php index fedb108..6045484 100644 --- a/core/modules/workflows/src/Plugin/WorkflowTypeBase.php +++ b/core/modules/workflows/src/Plugin/WorkflowTypeBase.php @@ -398,7 +398,7 @@ public function setTransitionWeight($transition_id, $weight) { } if (!is_numeric($weight)) { $label = $this->getTransition($transition_id)->label(); - throw new \InvalidArgumentException("The weight '$weight' must be numeric for state '$label'."); + throw new \InvalidArgumentException("The weight '$weight' must be numeric for transition '$label'."); } $this->configuration['transitions'][$transition_id]['weight'] = $weight; return $this; diff --git a/core/modules/workflows/tests/src/Unit/WorkflowTest.php b/core/modules/workflows/tests/src/Unit/WorkflowTest.php index 10aa65a..dc77a3d 100644 --- a/core/modules/workflows/tests/src/Unit/WorkflowTest.php +++ b/core/modules/workflows/tests/src/Unit/WorkflowTest.php @@ -570,11 +570,11 @@ public function testSetTransitionWeightException() { * @covers ::setTransitionWeight */ public function testSetTransitionWeightNonNumericException() { - $this->setExpectedException(\InvalidArgumentException::class, "The weight 'foo' must be numeric for state 'Published'."); + $this->setExpectedException(\InvalidArgumentException::class, "The weight 'foo' must be numeric for transition 'Publish'."); $workflow = new Workflow(['id' => 'test', 'type' => 'test_type'], 'workflow'); $workflow->getTypePlugin()->addState('published', 'Published'); - $workflow->getTypePlugin()->addTransition('published', 'Published', [], 'published'); - $workflow->getTypePlugin()->setTransitionWeight('published', 'foo'); + $workflow->getTypePlugin()->addTransition('publish', 'Publish', [], 'published'); + $workflow->getTypePlugin()->setTransitionWeight('publish', 'foo'); } /**