/** * Convert a string to DateTime * * @param string $value * * @return \DateTime * * @throws \Exception */ protected function convertToDateTime($value) { return DateTimeParser::parse($value); }
/** * @dataProvider parseFailureProvider */ public function testParseFailure($strDate, $exceptionMessage) { $this->setExpectedException('\\InvalidArgumentException', $exceptionMessage); DateTimeParser::parse($strDate); }