function GroupDisplayTestCase::testFieldAccess in Field Group 7
Test if an empty formatter.
File
- tests/
field_group.display.test, line 101 - Test file for fieldgroup display.
Class
- GroupDisplayTestCase
- Group display tests
Code
function testFieldAccess() {
$data = array(
'label' => 'Wrapper',
'weight' => '1',
'children' => array(
0 => 'field_no_access',
),
'format_type' => 'div',
'format_settings' => array(
'label' => 'Link',
'instance_settings' => array(
'required_fields' => 0,
'id' => 'wrapper-id',
'classes' => 'test-class',
'description' => '',
'show_label' => FALSE,
'label_element' => 'h3',
'effect' => 'blink',
'speed' => 'fast',
),
'formatter' => 'open',
),
);
$group = $this
->createGroup('default', $data);
$groups = field_group_info_groups('node', 'article', 'default', TRUE);
$this
->drupalGet('node/' . $this->node->nid);
// Test if group is not shown.
$this
->assertNoFieldByXPath("//div[contains(@id, 'wrapper-id')]", NULL, t('Div that contains fields with no access is not shown.'));
}