Пример #1
0
 public function testGetYear()
 {
     $calendar = new Calendar();
     $year = $calendar->getYear(new \DateTime('2012-01'));
     $this->assertInstanceOf('CalendR\\Period\\Year', $year);
     $year = $calendar->getYear(2012);
     $this->assertInstanceOf('CalendR\\Period\\Year', $year);
 }
Пример #2
0
 public function testFactoryTransmitDefaultWeekday()
 {
     $calendar = new Calendar();
     $calendar->setFirstWeekday(Day::SUNDAY);
     $this->assertSame(Day::SUNDAY, $calendar->getYear(2013)->getFirstWeekday());
     $this->assertSame(Day::SUNDAY, $calendar->getMonth(2013, 1)->getFirstWeekday());
     $this->assertSame(Day::SUNDAY, $calendar->getWeek(2013, 1)->getFirstWeekday());
     $this->assertSame(Day::SUNDAY, $calendar->getDay(2013, 1, 1)->getFirstWeekday());
 }