public static function modify($dateAsString, $interval, $format = self::DEFAULT_TIME_FORMAT)
{
$dateTime = new DateTime($dateAsString);
return $dateTime->modify($interval)->format($format);
}
/** * @test * @dataProvider intervalsAndDates * @param string $interval * @param string $expectedDate */ public function shouldModifyDate($interval, $expectedDate) { //when $date = Date::modify('2010-01-20 12:00', $interval); //then $this->assertEquals($expectedDate, $date); }