Esempio n. 1
0
 public function testGetDay()
 {
     $calendar = new Calendar();
     $day = $calendar->getDay(new \DateTime('2012-01-01'));
     $this->assertInstanceOf('CalendR\\Period\\Day', $day);
     $day = $calendar->getDay(2012, 1, 1);
     $this->assertInstanceOf('CalendR\\Period\\Day', $day);
 }
 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());
 }