namespace Symfony\Component\Form\Tests\Extension\Core\DataTransformer;
use Symfony\Component\Form\Exception\TransformationFailedException;
use Symfony\Component\Form\Extension\Core\DataTransformer\BaseDateTimeTransformer;
use Symfony\Component\Form\Extension\Core\DataTransformer\DateTimeToArrayTransformer;
class DateTimeToArrayTransformerTest extends BaseDateTimeTransformerTestCase
{ public function testTransform() { $transformer =
new DateTimeToArrayTransformer('UTC', 'UTC'
);
$input =
new \
DateTime('2010-02-03 04:05:06 UTC'
);
$output =
[ 'year' => '2010',
'month' => '2',
'day' => '3',
'hour' => '4',
'minute' => '5',
'second' => '6',
];