當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Tab::rootFieldSet方法代碼示例

本文整理匯總了PHP中Tab::rootFieldSet方法的典型用法代碼示例。如果您正苦於以下問題:PHP Tab::rootFieldSet方法的具體用法?PHP Tab::rootFieldSet怎麽用?PHP Tab::rootFieldSet使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Tab的用法示例。


在下文中一共展示了Tab::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());
 }
開發者ID:SustainableCoastlines,項目名稱:loveyourwater,代碼行數:19,代碼來源:FieldSetTest.php


注:本文中的Tab::rootFieldSet方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。