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:
commit
402d474a96
@ -910,7 +910,7 @@ class Form implements \IteratorAggregate, FormInterface
|
|||||||
$options['auto_initialize'] = false;
|
$options['auto_initialize'] = false;
|
||||||
|
|
||||||
if (null === $type && null === $this->config->getDataClass()) {
|
if (null === $type && null === $this->config->getDataClass()) {
|
||||||
$type = 'text';
|
$type = 'Symfony\Component\Form\Extension\Core\Type\TextType';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (null === $type) {
|
if (null === $type) {
|
||||||
|
@ -172,13 +172,13 @@ class CompoundFormTest extends AbstractFormTest
|
|||||||
|
|
||||||
$this->factory->expects($this->once())
|
$this->factory->expects($this->once())
|
||||||
->method('createNamed')
|
->method('createNamed')
|
||||||
->with('foo', 'text', null, array(
|
->with('foo', 'Symfony\Component\Form\Extension\Core\Type\TextType', null, array(
|
||||||
'bar' => 'baz',
|
'bar' => 'baz',
|
||||||
'auto_initialize' => false,
|
'auto_initialize' => false,
|
||||||
))
|
))
|
||||||
->will($this->returnValue($child));
|
->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->assertTrue($this->form->has('foo'));
|
||||||
$this->assertSame($this->form, $child->getParent());
|
$this->assertSame($this->form, $child->getParent());
|
||||||
@ -191,14 +191,14 @@ class CompoundFormTest extends AbstractFormTest
|
|||||||
|
|
||||||
$this->factory->expects($this->once())
|
$this->factory->expects($this->once())
|
||||||
->method('createNamed')
|
->method('createNamed')
|
||||||
->with('0', 'text', null, array(
|
->with('0', 'Symfony\Component\Form\Extension\Core\Type\TextType', null, array(
|
||||||
'bar' => 'baz',
|
'bar' => 'baz',
|
||||||
'auto_initialize' => false,
|
'auto_initialize' => false,
|
||||||
))
|
))
|
||||||
->will($this->returnValue($child));
|
->will($this->returnValue($child));
|
||||||
|
|
||||||
// in order to make casting unnecessary
|
// 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->assertTrue($this->form->has(0));
|
||||||
$this->assertSame($this->form, $child->getParent());
|
$this->assertSame($this->form, $child->getParent());
|
||||||
@ -211,7 +211,7 @@ class CompoundFormTest extends AbstractFormTest
|
|||||||
|
|
||||||
$this->factory->expects($this->once())
|
$this->factory->expects($this->once())
|
||||||
->method('createNamed')
|
->method('createNamed')
|
||||||
->with('foo', 'text')
|
->with('foo', 'Symfony\Component\Form\Extension\Core\Type\TextType')
|
||||||
->will($this->returnValue($child));
|
->will($this->returnValue($child));
|
||||||
|
|
||||||
$this->form->add('foo');
|
$this->form->add('foo');
|
||||||
|
Reference in New Issue
Block a user