assertEquals(0, $compositeOuter->fieldPosition('A'));
$this->assertEquals(1, $compositeOuter->fieldPosition('B'));
$this->assertEquals(3, $compositeOuter->fieldPosition('D'));
$this->assertEquals(0, $compositeInner->fieldPosition('C1'));
$this->assertEquals(1, $compositeInner->fieldPosition('C2'));
$compositeOuter->insertBefore('B', new TextField('AB'));
$this->assertEquals(0, $compositeOuter->fieldPosition('A'));
$this->assertEquals(1, $compositeOuter->fieldPosition('AB'));
$this->assertEquals(2, $compositeOuter->fieldPosition('B'));
}
public function testTag()
{
$div = new CompositeField(
new TextField('A'),
new TextField('B')
);
$this->assertStringStartsWith('
FieldHolder()));
$this->assertStringEndsWith('/div>', trim($div->FieldHolder()));
$fieldset = new CompositeField();
$fieldset->setTag('fieldset');
$this->assertStringStartsWith('