本文整理汇总了PHP中Symfony\Component\Form\FormBuilder::getFormConfig方法的典型用法代码示例。如果您正苦于以下问题:PHP FormBuilder::getFormConfig方法的具体用法?PHP FormBuilder::getFormConfig怎么用?PHP FormBuilder::getFormConfig使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Symfony\Component\Form\FormBuilder
的用法示例。
在下文中一共展示了FormBuilder::getFormConfig方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testGetFormConfigErasesReferences
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));
}