[Form] simplified a test from previous merge
This commit is contained in:
parent
ac24f3e514
commit
1c0ba78833
@ -15,20 +15,12 @@ use Symfony\Component\HttpFoundation\File\UploadedFile;
|
|||||||
|
|
||||||
class FileTypeTest extends TypeTestCase
|
class FileTypeTest extends TypeTestCase
|
||||||
{
|
{
|
||||||
|
|
||||||
public function testFormBuilderIfEntityHasFile()
|
public function testFormBuilderIfEntityHasFile()
|
||||||
{
|
{
|
||||||
$entity = new \StdClass;
|
$this->factory->createBuilder('file')
|
||||||
$entity->imageFile = $this->createUploadedFileMock('abcdef', 'original.jpg', true);
|
->getForm()
|
||||||
|
->setData($this->createUploadedFileMock('abcdef', 'original.jpg', true))
|
||||||
try {
|
;
|
||||||
$form = $this->factory->createBuilder('form', $entity)
|
|
||||||
->add('imageFile', 'file')
|
|
||||||
->getForm();
|
|
||||||
return;
|
|
||||||
} catch (\Symfony\Component\Form\Exception\FormException $e) {
|
|
||||||
$this->fail();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testDontPassValueToView()
|
public function testDontPassValueToView()
|
||||||
|
Reference in New Issue
Block a user