19 declare(strict_types=1);
33 $this->assertInstanceOf(Range::class,
$range);
42 $this->assertEquals(1, $range->
getStart());
43 $this->assertEquals(2, $range->
getLength());
51 $this->assertEquals(3, $range->
getEnd());
60 $this->assertEquals(1, $range->
getStart());
61 $this->assertEquals(3, $range->
getLength());
62 $this->assertEquals(4, $range->
getEnd());
72 $this->assertEquals(3, $range->
getStart());
73 $this->assertEquals(3, $range->
getLength());
74 $this->assertEquals(6, $range->
getEnd());
94 $this->expectException(InvalidArgumentException::class);
103 $this->expectException(InvalidArgumentException::class);
109 $this->expectException(InvalidArgumentException::class);
116 $this->expectException(InvalidArgumentException::class);
127 $range =
$f->range($start, $length);
131 $this->assertEquals(
$range, $cropped);
133 $this->assertEquals(min($max, $start), $cropped->getStart());
134 $this->assertEquals($max, $cropped->getEnd());
141 [0, 100, 1000,
false],
142 [0, 1000, 100,
true],
144 [50, 100, 200,
false],
testNegativeStart(Range $range)
testFactory
testConstructionWrongStart()
testNegativeLength(Range $range)
testFactory
testEndCalculation(Range $range)
testFactory
testConstructionWrongLength()
testWithStart(Range $range)
testWithLength
croppedTo(int $max)
This will create a range that is guaranteed to not exceed $max.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
testWithLength(Range $range)
testFactory
testCroppedTo($start, $length, $max, $has_changed)
cropCases
A simple class to express a naive range of whole positive numbers.
testValues(Range $range)
testFactory
testUnpack(Range $range)
testWithStart