public function testGetFormConfigErasesReferences() { $builder = new FormBuilder('name', null, $this->dispatcher, $this->factory); $builder->setParent(new FormBuilder('parent', null, $this->dispatcher, $this->factory)); $builder->add(new FormBuilder('child', null, $this->dispatcher, $this->factory)); $config = $builder->getFormConfig(); $reflClass = new \ReflectionClass($config); $factory = $reflClass->getProperty('factory'); $parent = $reflClass->getProperty('parent'); $children = $reflClass->getProperty('children'); $unresolvedChildren = $reflClass->getProperty('unresolvedChildren'); $factory->setAccessible(true); $parent->setAccessible(true); $children->setAccessible(true); $unresolvedChildren->setAccessible(true); $this->assertNull($factory->getValue($config)); $this->assertNull($parent->getValue($config)); $this->assertEmpty($children->getValue($config)); $this->assertEmpty($unresolvedChildren->getValue($config)); }