[Form] Fixed wrong usages of the "text" type

This commit is contained in:
Bernhard Schussek 2015-11-26 09:12:29 +01:00
parent da43309f07
commit 91496229ab
2 changed files with 6 additions and 6 deletions

View File

@ -910,7 +910,7 @@ class Form implements \IteratorAggregate, FormInterface
$options['auto_initialize'] = false;
if (null === $type && null === $this->config->getDataClass()) {
$type = 'text';
$type = 'Symfony\Component\Form\Extension\Core\Type\TextType';
}
if (null === $type) {

View File

@ -172,13 +172,13 @@ class CompoundFormTest extends AbstractFormTest
$this->factory->expects($this->once())
->method('createNamed')
->with('foo', 'text', null, array(
->with('foo', 'Symfony\Component\Form\Extension\Core\Type\TextType', null, array(
'bar' => 'baz',
'auto_initialize' => false,
))
->will($this->returnValue($child));
$this->form->add('foo', 'text', array('bar' => 'baz'));
$this->form->add('foo', 'Symfony\Component\Form\Extension\Core\Type\TextType', array('bar' => 'baz'));
$this->assertTrue($this->form->has('foo'));
$this->assertSame($this->form, $child->getParent());
@ -191,14 +191,14 @@ class CompoundFormTest extends AbstractFormTest
$this->factory->expects($this->once())
->method('createNamed')
->with('0', 'text', null, array(
->with('0', 'Symfony\Component\Form\Extension\Core\Type\TextType', null, array(
'bar' => 'baz',
'auto_initialize' => false,
))
->will($this->returnValue($child));
// in order to make casting unnecessary
$this->form->add(0, 'text', array('bar' => 'baz'));
$this->form->add(0, 'Symfony\Component\Form\Extension\Core\Type\TextType', array('bar' => 'baz'));
$this->assertTrue($this->form->has(0));
$this->assertSame($this->form, $child->getParent());
@ -211,7 +211,7 @@ class CompoundFormTest extends AbstractFormTest
$this->factory->expects($this->once())
->method('createNamed')
->with('foo', 'text')
->with('foo', 'Symfony\Component\Form\Extension\Core\Type\TextType')
->will($this->returnValue($child));
$this->form->add('foo');