transform() public method

Transforms a normalized date into a localized date string/array.
public transform ( DateTime $dateTime ) : string | array
$dateTime DateTime Normalized date.
return string | array Localized date string/array.
 public function testTransformRequiresValidDateTime()
 {
     $transformer = new DateTimeToLocalizedStringTransformer();
     $this->setExpectedException('\\InvalidArgumentException');
     $transformer->transform('2010-01-01');
 }
 public function testTransformRequiresValidDateTime()
 {
     $transformer = new DateTimeToLocalizedStringTransformer();
     $this->setExpectedException('Symfony\\Component\\Form\\Exception\\UnexpectedTypeException');
     $transformer->transform('2010-01-01');
 }