bug #16677 [Form] Fixed wrong usages of the "text" type (webmozart)

This PR was merged into the 2.8 branch.

Discussion
----------

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

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

Commits
-------

9149622 [Form] Fixed wrong usages of the "text" type
This commit is contained in:
Fabien Potencier 2015-11-26 18:59:59 +01:00
commit 402d474a96
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');