fixed issue with clone now the children of the original form are preserved and the clone form is given new children

This commit is contained in:
Joseph Deray 2013-10-30 18:44:30 -04:00
parent 61dd06ea27
commit b952bcbf9a
2 changed files with 3 additions and 0 deletions

View File

@ -170,6 +170,8 @@ class Form implements \IteratorAggregate, FormInterface
public function __clone()
{
$this->children = clone $this->children;
foreach ($this->children as $key => $child) {
$this->children[$key] = clone $child;
}

View File

@ -141,6 +141,7 @@ class CompoundFormTest extends AbstractFormTest
$this->assertNotSame($this->form, $clone);
$this->assertNotSame($child, $clone['child']);
$this->assertNotSame($this->form['child'], $clone['child']);
}
public function testNotEmptyIfChildNotEmpty()