public function testCalendarGetOption()
 {
     $calendar = new Calendar();
     $this->assertEquals(1, $calendar->getFactory()->getFirstWeekday());
     $calendar->setFactory(new Factory(array('first_weekday' => 0)));
     $this->assertEquals(0, $calendar->getFactory()->getFirstWeekday());
 }
Esempio n. 2
0
 /**
  * @dataProvider weekAndWeekdayProvider
  */
 public function testGetWeekWithWeekdayConfiguration($year, $week, $weekday, $day)
 {
     $calendar = new Calendar();
     $calendar->getFactory()->setFirstWeekday($weekday);
     $week = $calendar->getWeek($year, $week);
     $this->assertEquals($weekday, $week->format('w'));
     $this->assertSame($day, $week->format('Y-m-d'));
 }