make(Automation::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 AutomationWalker())->walk($automation, [new ConsistentStepMapRule()]); } public function testItPassesWithCorrectKeyValuePair(): void { $automation = $this->make(Automation::class, ['getSteps' => [ 'root' => $this->createStep('root'), ]]); (new AutomationWalker())->walk($automation, [new ConsistentStepMapRule()]); // no exception thrown } }