Jyxo\Time\UtilTest::testNextMonth PHP Method

testNextMonth() public method

Tests the nextMonth() method.
public testNextMonth ( )
    public function testNextMonth()
    {
        $dates = ['2010-01-01' => '2010-02-01', '2010-01-31' => '2010-02-28', '2012-01-31' => '2012-02-29', '2010-12-31' => '2011-01-31', '2010-08-31' => '2010-09-30'];
        foreach ($dates as $current => $expected) {
            $time = new Time($current);
            $next = Util::nextMonth($time);
            $this->assertEquals($expected . ' 00:00:00', $next->format('Y-m-d H:i:s'));
        }
    }