use Symfony\Component\Form\RequestHandlerInterface;
use Symfony\Component\HttpFoundation\File\File;
use Symfony\Component\HttpFoundation\File\UploadedFile;
use Symfony\Component\Translation\IdentityTranslator;
class FileTypeTest extends BaseTypeTestCase
{ public const TESTED_TYPE = 'Symfony\Component\Form\Extension\Core\Type\FileType';
protected function getExtensions() { return array_merge(parent::
getExtensions(),
[new CoreExtension(null, null,
new IdentityTranslator())]);
} // https://github.com/symfony/symfony/pull/5028
public function testSetData() { $form =
$this->factory->
createBuilder(static::TESTED_TYPE
)->
getForm();
$data =
new File(__DIR__.'/../../../Fixtures/foo', false
);
$form->
setData($data);
// Ensures the data class is defined to accept File instance