Example #1
0
 /**
  * test past
  * @group Core
  */
 public function testYearPastAndWrongdate()
 {
     $correct = array('2000-01-01', '2000-02-01', '2000-03-01', '2000-04-01', '2000-05-01', '2000-06-01', '2000-07-01', '2000-08-01', '2000-09-01', '2000-10-01', '2000-11-01', '2000-12-01');
     $year = new Year(Date::factory('2000-02-15'));
     $this->assertEquals(12, $year->getNumberOfSubperiods());
     $this->assertEquals($correct, $year->toString());
 }
Example #2
0
 public function testCustomRangeYearUsesCurrentYear_onLastDayOfYear()
 {
     $range = new Range('range', '2013-01-01,2013-12-31', 'UTC', Date::factory('2013-12-31'));
     $year2013 = new Year(Date::factory('2013-01-01'));
     $correct = array($year2013->toString());
     $this->assertEquals(1, $range->getNumberOfSubperiods());
     $this->assertEquals($correct, $range->toString());
 }