public function testMonthDSTChangeOct() { $month = new Month(Date::factory("2017-10-31")); $correct = array("2017-10-01", array("2017-10-02", "2017-10-03", "2017-10-04", "2017-10-05", "2017-10-06", "2017-10-07", "2017-10-08"), array("2017-10-09", "2017-10-10", "2017-10-11", "2017-10-12", "2017-10-13", "2017-10-14", "2017-10-15"), array("2017-10-16", "2017-10-17", "2017-10-18", "2017-10-19", "2017-10-20", "2017-10-21", "2017-10-22"), array("2017-10-23", "2017-10-24", "2017-10-25", "2017-10-26", "2017-10-27", "2017-10-28", "2017-10-29"), "2017-10-30", "2017-10-31"); $this->assertEquals($correct, $month->toString()); $this->assertEquals(7, $month->getNumberOfSubperiods()); }
public function _testRangeLastmonth_onFirstOfMonth() { $end = Date::factory('2013-11-01'); $range = new Range('month', 'last10', 'UTC', $end); $correct = array(); for ($i = 0; $i < 10; $i++) { $date = $end->subMonth($i); $week = new Month($date); $correct[] = $week->toString(); } $correct = array_reverse($correct); $this->assertEquals(10, $range->getNumberOfSubperiods()); $this->assertEquals($correct, $range->toString()); }