Skip to content

Commit 6c80ab1

Browse files
committed
[Form] Fixed wrong usages of the "text" type
1 parent da43309 commit 6c80ab1

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

src/Symfony/Component/Form/Form.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@
1111

1212
namespace Symfony\Component\Form;
1313

14-
use Symfony\Component\Form\Exception\RuntimeException;
15-
use Symfony\Component\Form\Exception\UnexpectedTypeException;
1614
use Symfony\Component\Form\Exception\AlreadySubmittedException;
17-
use Symfony\Component\Form\Exception\TransformationFailedException;
1815
use Symfony\Component\Form\Exception\LogicException;
1916
use Symfony\Component\Form\Exception\OutOfBoundsException;
17+
use Symfony\Component\Form\Exception\RuntimeException;
18+
use Symfony\Component\Form\Exception\TransformationFailedException;
19+
use Symfony\Component\Form\Exception\UnexpectedTypeException;
2020
use Symfony\Component\Form\Util\FormUtil;
2121
use Symfony\Component\Form\Util\InheritDataAwareIterator;
2222
use Symfony\Component\Form\Util\OrderedHashMap;
@@ -910,7 +910,7 @@ public function add($child, $type = null, array $options = array())
910910
$options['auto_initialize'] = false;
911911

912912
if (null === $type && null === $this->config->getDataClass()) {
913-
$type = 'text';
913+
$type = 'Symfony\Component\Form\Extension\Core\Type\TextType';
914914
}
915915

916916
if (null === $type) {

src/Symfony/Component/Form/Tests/CompoundFormTest.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@
1717
use Symfony\Component\Form\Forms;
1818
use Symfony\Component\Form\FormView;
1919
use Symfony\Component\Form\SubmitButtonBuilder;
20-
use Symfony\Component\HttpFoundation\Request;
21-
use Symfony\Component\HttpFoundation\File\UploadedFile;
2220
use Symfony\Component\Form\Tests\Fixtures\FixedDataTransformer;
21+
use Symfony\Component\HttpFoundation\File\UploadedFile;
22+
use Symfony\Component\HttpFoundation\Request;
2323

2424
class CompoundFormTest extends AbstractFormTest
2525
{
@@ -172,13 +172,13 @@ public function testAddUsingNameAndType()
172172

173173
$this->factory->expects($this->once())
174174
->method('createNamed')
175-
->with('foo', 'text', null, array(
175+
->with('foo', 'Symfony\Component\Form\Extension\Core\Type\TextType', null, array(
176176
'bar' => 'baz',
177177
'auto_initialize' => false,
178178
))
179179
->will($this->returnValue($child));
180180

181-
$this->form->add('foo', 'text', array('bar' => 'baz'));
181+
$this->form->add('foo', 'Symfony\Component\Form\Extension\Core\Type\TextType', array('bar' => 'baz'));
182182

183183
$this->assertTrue($this->form->has('foo'));
184184
$this->assertSame($this->form, $child->getParent());
@@ -191,14 +191,14 @@ public function testAddUsingIntegerNameAndType()
191191

192192
$this->factory->expects($this->once())
193193
->method('createNamed')
194-
->with('0', 'text', null, array(
194+
->with('0', 'Symfony\Component\Form\Extension\Core\Type\TextType', null, array(
195195
'bar' => 'baz',
196196
'auto_initialize' => false,
197197
))
198198
->will($this->returnValue($child));
199199

200200
// in order to make casting unnecessary
201-
$this->form->add(0, 'text', array('bar' => 'baz'));
201+
$this->form->add(0, 'Symfony\Component\Form\Extension\Core\Type\TextType', array('bar' => 'baz'));
202202

203203
$this->assertTrue($this->form->has(0));
204204
$this->assertSame($this->form, $child->getParent());
@@ -211,7 +211,7 @@ public function testAddWithoutType()
211211

212212
$this->factory->expects($this->once())
213213
->method('createNamed')
214-
->with('foo', 'text')
214+
->with('foo', 'Symfony\Component\Form\Extension\Core\Type\TextType')
215215
->will($this->returnValue($child));
216216

217217
$this->form->add('foo');

0 commit comments

Comments
 (0)