/** * @dataProvider dateRanges */ public function testparseDateRange($range, $start, $end) { $this->time_date->setNow(SugarDateTime::createFromFormat(TimeDate::DB_DATETIME_FORMAT, "2011-08-30 12:01:02", new DateTimeZone($this->time_date->userTimezone()))); $this->time_date->allow_cache = true; $daterage = $this->time_date->parseDateRange($range); $this->assertEquals($start, $daterage[0]->format(TimeDate::DB_DATETIME_FORMAT), 'Start date is wrong'); $this->assertEquals($end, $daterage[1]->format(TimeDate::DB_DATETIME_FORMAT), 'End date is wrong'); }