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()
|
||||
{
|
||||
if ($this->rendered) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (isset($this->vars['compound']) ? !$this->vars['compound'] : 0 === count($this->children)) {
|
||||
return false;
|
||||
if (true === $this->rendered || 0 === count($this->children)) {
|
||||
return $this->rendered;
|
||||
}
|
||||
|
||||
foreach ($this->children as $child) {
|
||||
|
|
|
@ -488,67 +488,16 @@ class FormTypeTest extends BaseTypeTest
|
|||
$this->assertTrue($view->vars['multipart']);
|
||||
}
|
||||
|
||||
public function testViewIsConsideredRenderedForRenderedNonCompoundForms()
|
||||
public function testViewIsNotRenderedByDefault()
|
||||
{
|
||||
$view = $this->factory->createBuilder('form', null, array(
|
||||
'compound' => false,
|
||||
))
|
||||
->getForm()
|
||||
->createView();
|
||||
|
||||
$view->setRendered();
|
||||
|
||||
$this->assertTrue($view->isRendered());
|
||||
}
|
||||
|
||||
public function testViewIsNotConsideredRenderedImplicitlyForNonCompoundForms()
|
||||
{
|
||||
$view = $this->factory->createBuilder('form', null, array(
|
||||
'compound' => false,
|
||||
))
|
||||
->getForm()
|
||||
->createView();
|
||||
$view = $this->factory->createBuilder('form')
|
||||
->add('foo', 'form')
|
||||
->getForm()
|
||||
->createView();
|
||||
|
||||
$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()
|
||||
{
|
||||
$form = $this->factory->create('form', null, array(
|
||||
|
|
Reference in New Issue