make(Workflow::class, ['getSteps' => [ 'root' => $this->createStep('a'), ]]); $this->expectException(UnexpectedValueException::class); $this->expectExceptionMessage("Invalid automation structure: Step with ID 'a' stored under a mismatched index 'root'."); (new WorkflowWalker())->walk($workflow, [new ConsistentStepMapRule()]); } public function testItPassesWithCorrectKeyValuePair(): void { $workflow = $this->make(Workflow::class, ['getSteps' => [ 'root' => $this->createStep('root'), ]]); (new WorkflowWalker())->walk($workflow, [new ConsistentStepMapRule()]); // no exception thrown } }