Jyxo\Spl\ArrayUtilTest::testRangeCompare PHP Method

testRangeCompare() public method

Tests use of custom closures.
public testRangeCompare ( )
    public function testRangeCompare()
    {
        $called = 0;
        $range = ArrayUtil::range(1, 6, function ($current) {
            return $current + 1;
        }, function ($a, $b) use(&$called) {
            ++$called;
            return $a < $b;
        });
        $this->assertEquals(range(1, 6), $range);
        $this->assertEquals(count($range), $called);
    }