Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 9149622

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

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/Symfony/Component/Form/Form.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -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)