Add missing exception message

[MAILPOET-4629]
This commit is contained in:
Jan Jakes
2022-09-22 15:26:06 +02:00
committed by David Remer
parent 8c2377b0f9
commit 76d2d40198
2 changed files with 5 additions and 2 deletions

View File

@ -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)
);
} }
} }
} }

View File

@ -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()]);
} }