given($iterator = new LUT\Counter(0, 12, 3)) ->when($result = iterator_to_array($iterator)) ->then ->array($result) ->isEqualTo([0, 3, 6, 9]); } public function case_offset() { $this ->given($iterator = new LUT\Counter(6, 12, 3)) ->when($result = iterator_to_array($iterator)) ->then ->array($result) ->isEqualTo([6, 9]); } public function case_too_small() { $this ->exception(function () { new LUT\Counter(0, 0, 0); }) ->isInstanceOf(LUT\Exception::class); } public function case_too_big() { $this ->given($iterator = new LUT\Counter(0, 12, 13)) ->when($result = iterator_to_array($iterator)) ->then ->array($result) ->isEqualTo([0]); } }