add validation to accompanying periods

This commit is contained in:
2021-11-12 12:07:31 +00:00
parent 39ab7057ce
commit c8135e0741
22 changed files with 337 additions and 88 deletions

View File

@@ -37,6 +37,18 @@ class DateRangeCoveringTest extends TestCase
$this->assertNotContains(3, $cover->getIntersections()[0][2]);
}
public function testCoveringWithMinCover1_NoCoveringWithNullDates()
{
$cover = new DateRangeCovering(1, new \DateTimeZone('Europe/Brussels'));
$cover
->add(new \DateTime('2021-10-05'), new \DateTime('2021-10-18'), 521)
->add(new \DateTime('2021-10-26'), null, 663)
->compute()
;
$this->assertFalse($cover->hasIntersections());
}
public function testCoveringWithMinCover1WithTwoIntersections()
{
$cover = new DateRangeCovering(1, new \DateTimeZone('Europe/Brussels'));