[FakeAdvanceStep::class, FakeRetryStep::class]]); expect($registry->count('host'))->toBe(2) ->and($registry->resolve('host', 0))->toBeInstanceOf(FakeAdvanceStep::class) ->and($registry->resolve('host', 1))->toBeInstanceOf(FakeRetryStep::class); }); it('throws for an unknown pipeline', function () { (new PipelineRegistry([]))->stepsFor('nope'); })->throws(InvalidArgumentException::class); it('throws for an out-of-range step index', function () { (new PipelineRegistry(['host' => [FakeAdvanceStep::class]]))->resolve('host', 5); })->throws(InvalidArgumentException::class);