public function testFromDayOfYearFactoryMethodRespectsDistanceBetweenDays() { $this->forAll(Generator\choose(2000, 2020), Generator\choose(0, 364), Generator\choose(0, 364))->then(function ($year, $dayOfYear, $anotherDayOfYear) { $day = UTCDateTime::fromZeroBasedDayOfYear($year, $dayOfYear); $anotherDay = UTCDateTime::fromZeroBasedDayOfYear($year, $anotherDayOfYear); $this->assertEquals(abs($dayOfYear - $anotherDayOfYear) * 86400, abs($day->differenceInSeconds($anotherDay)), "Days of the year {$year}: {$dayOfYear}, {$anotherDayOfYear}" . PHP_EOL . "{$day->toIso8601()}, {$anotherDay->toIso8601()}"); }); }