mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
ENHANCEMENT Added FieldSetTest->testRemoveTab()
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@63615 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
eca30eb89d
commit
b7d56b9e8a
@ -75,6 +75,20 @@ class FieldSetTest extends SapphireTest {
|
||||
$this->assertEquals(0, $tab->Fields()->Count());
|
||||
}
|
||||
|
||||
function testRemoveTab() {
|
||||
$fields = new FieldSet(new TabSet(
|
||||
'Root',
|
||||
$tab1 = new Tab('Tab1'),
|
||||
$tab2 = new Tab('Tab2'),
|
||||
$tab3 = new Tab('Tab3')
|
||||
));
|
||||
|
||||
$fields->removeByName('Tab2');
|
||||
$this->assertNull($fields->fieldByName('Root')->fieldByName('Tab2'));
|
||||
|
||||
$this->assertEquals($tab1, $fields->fieldByName('Root')->fieldByName('Tab1'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Test removing an array of fields from a tab in a set.
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user