mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
Add another test for addFieldToTab when creating tabs
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@62318 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
07f40d2cc6
commit
8eca8c3d7f
@ -336,6 +336,19 @@ class FieldSetTest extends SapphireTest {
|
|||||||
$this->assertEquals(0, $main->Fields()->Count());
|
$this->assertEquals(0, $main->Fields()->Count());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function testAddingFieldToNonExistentTabCreatesThatTab() {
|
||||||
|
$fieldSet = new FieldSet(
|
||||||
|
$root = new TabSet("Root",
|
||||||
|
$main = new Tab("Main",
|
||||||
|
$a = new TextField("A")
|
||||||
|
)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
$fieldSet->addFieldToTab("Root.Other", $b = new TextField("B"));
|
||||||
|
$this->assertSame($b, $fieldSet->fieldByName('Root')->fieldByName('Other')->Fields()->First());
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @TODO the same as above with insertBefore() and insertAfter()
|
* @TODO the same as above with insertBefore() and insertAfter()
|
||||||
*/
|
*/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user