public function testYearTransmitToMonth() { $year = new Year(new \DateTime('2013-01-01'), Day::SUNDAY); $this->assertSame(Day::SUNDAY, $year->getPrevious()->getFirstWeekday()); $this->assertSame(Day::SUNDAY, $year->getNext()->getFirstWeekday()); foreach ($year as $month) { $this->assertSame(Day::SUNDAY, $month->getFirstWeekday()); } }
public function testGetNext() { $year = new Year(new \DateTime('2012-01-01')); $this->assertEquals('2013-01-01', $year->getNext()->getBegin()->format('Y-m-d')); }
public function testGetNext() { $year = new Year(new \DateTime('2012-01-01'), $this->prophesize(FactoryInterface::class)->reveal()); $this->assertEquals('2013-01-01', $year->getNext()->getBegin()->format('Y-m-d')); }