function GroupUITestCase::deleteGroup in Field Group 7.2
Same name and namespace in other branches
- 7 tests/field_group.ui.test \GroupUITestCase::deleteGroup()
Delete a group.
1 call to GroupUITestCase::deleteGroup()
- GroupUITestCase::testCRUDGroup in ./
field_group.test - General CRUD.
File
- ./
field_group.test, line 114 - Unit test file for groups.
Class
- GroupUITestCase
- Group UI tests.
Code
function deleteGroup() {
$this
->drupalPost('admin/structure/types/manage/article/groups/' . $this->group_name . '/delete/form', array(), t('Delete'));
$this
->assertRaw(t('The group %label has been deleted from the %article content type.', array(
'%label' => $this->group_label,
'%article' => 'Article',
)), t('Group removal message displayed on screen.'));
// Test that group is not in the $groups array.
$groups = field_group_info_groups('node', 'article', 'form', TRUE);
$this
->assertFalse(array_key_exists($this->group_name, $groups), t('Group not found in groups array while deleting'));
$this
->drupalPost('admin/structure/types/manage/article/groups/' . $this->group_name . '/delete/default', array(), t('Delete'));
$this
->assertRaw(t('The group %label has been deleted from the %article content type.', array(
'%label' => $this->group_label,
'%article' => 'Article',
)), t('Group removal message displayed on screen.'));
// Test that group is not in the $groups array.
$groups = field_group_info_groups('node', 'article', 'default', TRUE);
$this
->assertFalse(array_key_exists($this->group_name, $groups), t('Group not found in groups array while deleting'));
}