コード例 #1
0
 public function testSetFirstWeekday()
 {
     $factory = new Calendar();
     $factory->setFirstWeekday(Day::FRIDAY);
     $this->assertSame(Day::FRIDAY, $factory->getFirstWeekday());
     $factory->setFirstWeekday(Day::THURSDAY);
     $this->assertSame(Day::THURSDAY, $factory->getFirstWeekday());
 }
コード例 #2
0
 public function testGetFirstWeekday()
 {
     $calendar = new Calendar();
     $factory = $this->getMock('CalendR\\Period\\FactoryInterface');
     $calendar->setFactory($factory);
     $factory->expects($this->once())->method('getFirstWeekday')->will($this->returnValue(Day::SUNDAY));
     $this->assertSame(Day::SUNDAY, $calendar->getFirstWeekday());
 }
コード例 #3
0
 public function testSetFirstWeekday()
 {
     $factory = new \CalendR\Calendar();
     $month = $factory->getMonth(2014, 5);
     $this->assertSame($factory->getFirstWeekday(), $month->getFirstWeekday());
     $month->setFirstWeekday(Day::FRIDAY);
     $this->assertSame(Day::FRIDAY, $factory->getFirstWeekday());
     $month->setFirstWeekday(Day::THURSDAY);
     $this->assertSame(Day::THURSDAY, $factory->getFirstWeekday());
 }