本文整理汇总了PHP中TabSet::rootFieldSet方法的典型用法代码示例。如果您正苦于以下问题:PHP TabSet::rootFieldSet方法的具体用法?PHP TabSet::rootFieldSet怎么用?PHP TabSet::rootFieldSet使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TabSet
的用法示例。
在下文中一共展示了TabSet::rootFieldSet方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testRootFieldSet
function testRootFieldSet()
{
/* Given a nested set of FormField, CompositeField, and FieldSet objects */
$fieldSet = new FieldSet($root = new TabSet("Root", $main = new Tab("Main", $a = new TextField("A"), $b = new TextField("B"))));
/* rootFieldSet() should always evaluate to the same object: the topmost fieldset */
$this->assertSame($fieldSet, $fieldSet->rootFieldSet());
$this->assertSame($fieldSet, $root->rootFieldSet());
$this->assertSame($fieldSet, $main->rootFieldSet());
$this->assertSame($fieldSet, $a->rootFieldSet());
$this->assertSame($fieldSet, $b->rootFieldSet());
/* If we push additional fields, they should also have the same rootFieldSet() */
$root->push($other = new Tab("Other"));
$other->push($c = new TextField("C"));
$root->push($third = new Tab("Third", $d = new TextField("D")));
$this->assertSame($fieldSet, $other->rootFieldSet());
$this->assertSame($fieldSet, $third->rootFieldSet());
$this->assertSame($fieldSet, $c->rootFieldSet());
$this->assertSame($fieldSet, $d->rootFieldSet());
}