/** * @expectedException \Symfony\Component\Serializer\Exception\UnexpectedValueException */ public function testInvalidDateThrowException() { $this->normalizer->denormalize('invalid date', \DateTimeInterface::class); }
/** * @expectedException \Symfony\Component\Serializer\Exception\UnexpectedValueException */ public function testDenormalizeFormatMismatchThrowsException() { $this->normalizer->denormalize('2016-01-01T00:00:00+00:00', \DateTimeInterface::class, null, array(DateTimeNormalizer::FORMAT_KEY => 'Y-m-d|')); }