Revert "bug #20080 [Form] compound forms without children should be considered rendered implicitly (backbone87)"
This reverts commiteae5a9ba0b
, reversing changes made tofd763ad5a3
.
This commit is contained in:
parent
eae5a9ba0b
commit
35091b1837
@ -65,12 +65,8 @@ class FormView implements \ArrayAccess, \IteratorAggregate, \Countable
|
|||||||
*/
|
*/
|
||||||
public function isRendered()
|
public function isRendered()
|
||||||
{
|
{
|
||||||
if ($this->rendered) {
|
if (true === $this->rendered || 0 === count($this->children)) {
|
||||||
return true;
|
return $this->rendered;
|
||||||
}
|
|
||||||
|
|
||||||
if (isset($this->vars['compound']) ? !$this->vars['compound'] : 0 === count($this->children)) {
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach ($this->children as $child) {
|
foreach ($this->children as $child) {
|
||||||
|
@ -488,67 +488,16 @@ class FormTypeTest extends BaseTypeTest
|
|||||||
$this->assertTrue($view->vars['multipart']);
|
$this->assertTrue($view->vars['multipart']);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testViewIsConsideredRenderedForRenderedNonCompoundForms()
|
public function testViewIsNotRenderedByDefault()
|
||||||
{
|
{
|
||||||
$view = $this->factory->createBuilder('form', null, array(
|
$view = $this->factory->createBuilder('form')
|
||||||
'compound' => false,
|
->add('foo', 'form')
|
||||||
))
|
->getForm()
|
||||||
->getForm()
|
->createView();
|
||||||
->createView();
|
|
||||||
|
|
||||||
$view->setRendered();
|
|
||||||
|
|
||||||
$this->assertTrue($view->isRendered());
|
|
||||||
}
|
|
||||||
|
|
||||||
public function testViewIsNotConsideredRenderedImplicitlyForNonCompoundForms()
|
|
||||||
{
|
|
||||||
$view = $this->factory->createBuilder('form', null, array(
|
|
||||||
'compound' => false,
|
|
||||||
))
|
|
||||||
->getForm()
|
|
||||||
->createView();
|
|
||||||
|
|
||||||
$this->assertFalse($view->isRendered());
|
$this->assertFalse($view->isRendered());
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testViewIsNotConsideredRenderedImplicitlyForCompoundFormsWithNonCompoundChildren()
|
|
||||||
{
|
|
||||||
$view = $this->factory->createBuilder('form')
|
|
||||||
->add('foo', 'form', array(
|
|
||||||
'compound' => false,
|
|
||||||
))
|
|
||||||
->getForm()
|
|
||||||
->createView();
|
|
||||||
|
|
||||||
$this->assertFalse($view->isRendered());
|
|
||||||
}
|
|
||||||
|
|
||||||
public function testViewIsConsideredRenderedImplicitlyForCompoundFormsWithRenderedNonCompoundChildren()
|
|
||||||
{
|
|
||||||
$view = $this->factory->createBuilder('form')
|
|
||||||
->add('foo', 'form', array(
|
|
||||||
'compound' => false,
|
|
||||||
))
|
|
||||||
->getForm()
|
|
||||||
->createView();
|
|
||||||
|
|
||||||
foreach ($view as $child) {
|
|
||||||
$child->setRendered();
|
|
||||||
}
|
|
||||||
|
|
||||||
$this->assertTrue($view->isRendered());
|
|
||||||
}
|
|
||||||
|
|
||||||
public function testViewIsConsideredRenderedImplicitlyForCompoundFormsWithoutChildren()
|
|
||||||
{
|
|
||||||
$view = $this->factory->createBuilder('form')
|
|
||||||
->getForm()
|
|
||||||
->createView();
|
|
||||||
|
|
||||||
$this->assertTrue($view->isRendered());
|
|
||||||
}
|
|
||||||
|
|
||||||
public function testErrorBubblingIfCompound()
|
public function testErrorBubblingIfCompound()
|
||||||
{
|
{
|
||||||
$form = $this->factory->create('form', null, array(
|
$form = $this->factory->create('form', null, array(
|
||||||
|
Reference in New Issue
Block a user