本文整理汇总了PHP中TabSet::insertBefore方法的典型用法代码示例。如果您正苦于以下问题:PHP TabSet::insertBefore方法的具体用法?PHP TabSet::insertBefore怎么用?PHP TabSet::insertBefore使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TabSet
的用法示例。
在下文中一共展示了TabSet::insertBefore方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testInsertBeforeWithNestedTabsets
/**
* @todo check actual placement of fields
*/
function testInsertBeforeWithNestedTabsets()
{
$fieldSetA = new FieldSet($tabSetA = new TabSet('TabSet_A', $tabA1 = new Tab('Tab_A1', new TextField('A_pre'), new TextField('A'), new TextField('A_post')), $tabB1 = new Tab('Tab_B1', new TextField('B'))));
$tabSetA->insertBefore($A_insertbefore = new TextField('A_insertbefore'), 'A');
$this->assertEquals($fieldSetA->dataFieldByName('A_insertbefore'), $A_insertbefore, 'Field on toplevel tab can be inserted');
$this->assertEquals(0, $tabA1->fieldPosition('A_pre'));
$this->assertEquals(1, $tabA1->fieldPosition('A_insertbefore'));
$this->assertEquals(2, $tabA1->fieldPosition('A'));
$this->assertEquals(3, $tabA1->fieldPosition('A_post'));
$fieldSetB = new FieldSet(new TabSet('TabSet_A', $tabsetB = new TabSet('TabSet_B', $tabB1 = new Tab('Tab_B1', new TextField('C')), $tabB2 = new Tab('Tab_B2', new TextField('B_pre'), new TextField('B'), new TextField('B_post')))));
$fieldSetB->insertBefore($B_insertbefore = new TextField('B_insertbefore'), 'B');
$this->assertSame($fieldSetB->dataFieldByName('B_insertbefore'), $B_insertbefore, 'Field on nested tab can be inserted');
$this->assertEquals(0, $tabB2->fieldPosition('B_pre'));
$this->assertEquals(1, $tabB2->fieldPosition('B_insertbefore'));
$this->assertEquals(2, $tabB2->fieldPosition('B'));
$this->assertEquals(3, $tabB2->fieldPosition('B_post'));
}