/** * Tests Arr::range() * * @dataProvider providerRange * @param integer $step The step between each value in the array * @param integer $max The max value of the range (inclusive) */ public function testRange($step, $max) { $range = Arr::range($step, $max); $this->assertSame((int) floor($max / $step), count($range)); $current = $step; foreach ($range as $key => $value) { $this->assertSame($key, $value); $this->assertSame($current, $key); $this->assertLessThanOrEqual($max, $key); $current += $step; } }