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()); }
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()); }
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()); }