More unittesting
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed

This commit is contained in:
2024-02-06 13:45:40 +00:00
parent 747f06f7c9
commit 99eb3271c2
5 changed files with 72 additions and 4 deletions

View File

@ -27,5 +27,19 @@ class RangeTest extends TestCase
$range = Range::inclusive(1, 10);
$this->assertEquals(1, $range->getMin());
$this->assertEquals(10, $range->getMax());
$this->assertEquals(FALSE, $range->isInRange(0));
$this->assertEquals(TRUE, $range->isInRange(1));
$this->assertEquals(TRUE, $range->isInRange(2));
$this->assertEquals(TRUE, $range->isInRange(9));
$this->assertEquals(TRUE, $range->isInRange(10));
$this->assertEquals(FALSE, $range->isInRange(11));
$range = Range::atLeast(20);
$this->assertEquals(20, $range->getMin());
$this->assertEquals(PHP_INT_MAX, $range->getMax());
$range = Range::exactly(5);
$this->assertEquals(5, $range->getMin());
$this->assertEquals(5, $range->getMax());
}
}