use Symfony\Component\Form\Exception\TransformationFailedException;
use Symfony\Component\Form\Exception\UnexpectedTypeException;
use Symfony\Component\Form\Extension\Core\DataTransformer\DateIntervalToArrayTransformer;
/**
* @author Steffen Roßkamp <steffen.rosskamp@gimmickmedia.de>
*/
class DateIntervalToArrayTransformerTest extends DateIntervalTestCase
{ public function testTransform() { $transformer =
new DateIntervalToArrayTransformer();
$input =
new \
DateInterval('P1Y2M3DT4H5M6S'
);
$output =
[ 'years' => '1',
'months' => '2',
'days' => '3',
'hours' => '4',
'minutes' => '5',
'seconds' => '6',
'invert' => false,
];
$this->
assertSame($output,
$transformer->
transform($input));
}