Add missing exception message
[MAILPOET-4629]
This commit is contained in:
@ -11,7 +11,10 @@ class ConsistentStepMapRule implements WorkflowNodeVisitor {
|
|||||||
public function initialize(Workflow $workflow): void {
|
public function initialize(Workflow $workflow): void {
|
||||||
foreach ($workflow->getSteps() as $id => $step) {
|
foreach ($workflow->getSteps() as $id => $step) {
|
||||||
if ($id !== $step->getId()) {
|
if ($id !== $step->getId()) {
|
||||||
throw Exceptions::workflowStructureNotValid(__('TODO', 'mailpoet'));
|
// translators: %1$s is the ID of the step, %2$s is its index in the steps object.
|
||||||
|
throw Exceptions::workflowStructureNotValid(
|
||||||
|
sprintf(__("Step with ID '%1\$s' stored under a mismatched index '%2\$s'.", 'mailpoet'), $step->getId(), $id)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -15,7 +15,7 @@ class ConsistentStepMapRuleTest extends WorkflowRuleTest {
|
|||||||
]]);
|
]]);
|
||||||
|
|
||||||
$this->expectException(UnexpectedValueException::class);
|
$this->expectException(UnexpectedValueException::class);
|
||||||
$this->expectExceptionMessage('Invalid workflow structure: TODO');
|
$this->expectExceptionMessage("Invalid workflow structure: Step with ID 'a' stored under a mismatched index 'root'.");
|
||||||
(new WorkflowWalker())->walk($workflow, [new ConsistentStepMapRule()]);
|
(new WorkflowWalker())->walk($workflow, [new ConsistentStepMapRule()]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user