Symfony\Component\Form\Tests\CompoundFormTest::testSubmitRestoresViewDataIfCompoundAndEmpty PHP Method

testSubmitRestoresViewDataIfCompoundAndEmpty() public method

* https://github.com/symfony/symfony/issues/4480
    public function testSubmitRestoresViewDataIfCompoundAndEmpty()
    {
        $mapper = $this->getDataMapper();
        $object = new \stdClass();
        $form = $this->getBuilder('name', null, 'stdClass')
            ->setCompound(true)
            ->setDataMapper($mapper)
            ->setData($object)
            ->getForm();

        $form->submit(array());

        $this->assertSame($object, $form->getData());
    }
CompoundFormTest