[Form] simplified a test from previous merge

This commit is contained in:
Fabien Potencier 2012-11-24 13:04:10 +01:00
parent ac24f3e514
commit 1c0ba78833

View File

@ -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()