" . $body_field . "
");
$this->entitiesSetLabelClass('hidden');
$this->drupalGet('node/' . $node->nid);
$this->assertRaw("
" . $body_field . "
");
$this->entitiesClearFieldSettings();
// ----------------------
// Custom field function.
// ----------------------
// With outer wrapper.
$edit = array(
'fields[body][settings_edit_form][settings][ft][func]' => 'theme_ds_field_expert',
'fields[body][settings_edit_form][settings][ft][ow]' => '1',
'fields[body][settings_edit_form][settings][ft][ow-el]' => 'div',
);
$this->dsEditFormatterSettings($edit);
$this->drupalGet('node/' . $node->nid);
$this->assertRaw("
");
// With outer div wrapper and class.
$edit = array(
'fields[body][settings_edit_form][settings][ft][ow]' => '1',
'fields[body][settings_edit_form][settings][ft][ow-el]' => 'div',
'fields[body][settings_edit_form][settings][ft][ow-cl]' => 'ow-class'
);
$this->dsEditFormatterSettings($edit);
$this->drupalGet('node/' . $node->nid);
$this->assertRaw("
");
// With outer span wrapper and class.
$edit = array(
'fields[body][settings_edit_form][settings][ft][ow]' => '1',
'fields[body][settings_edit_form][settings][ft][ow-el]' => 'span',
'fields[body][settings_edit_form][settings][ft][ow-cl]' => 'ow-class-2'
);
$this->dsEditFormatterSettings($edit);
$this->drupalGet('node/' . $node->nid);
$this->assertRaw("
");
// Clear field settings.
$this->entitiesClearFieldSettings();
// With outer wrapper and field items wrapper.
$edit = array(
'fields[body][settings_edit_form][settings][ft][func]' => 'theme_ds_field_expert',
'fields[body][settings_edit_form][settings][ft][ow]' => '1',
'fields[body][settings_edit_form][settings][ft][ow-el]' => 'div',
'fields[body][settings_edit_form][settings][ft][fis]' => '1',
'fields[body][settings_edit_form][settings][ft][fis-el]' => 'div'
);
$this->dsEditFormatterSettings($edit);
$this->drupalGet('node/' . $node->nid);
$this->assertRaw("
");
// With outer wrapper and field items div wrapper with class.
$edit = array(
'fields[body][settings_edit_form][settings][ft][ow]' => '1',
'fields[body][settings_edit_form][settings][ft][ow-el]' => 'div',
'fields[body][settings_edit_form][settings][ft][ow-el]' => 'div',
'fields[body][settings_edit_form][settings][ft][fis]' => '1',
'fields[body][settings_edit_form][settings][ft][fis-el]' => 'div',
'fields[body][settings_edit_form][settings][ft][fis-cl]' => 'fi-class'
);
$this->dsEditFormatterSettings($edit);
$this->drupalGet('node/' . $node->nid);
$this->assertRaw("
");
// With outer wrapper and field items span wrapper and class.
$edit = array(
'fields[body][settings_edit_form][settings][ft][ow]' => '1',
'fields[body][settings_edit_form][settings][ft][ow-el]' => 'div',
'fields[body][settings_edit_form][settings][ft][fis]' => '1',
'fields[body][settings_edit_form][settings][ft][fis-el]' => 'span',
'fields[body][settings_edit_form][settings][ft][fis-cl]' => 'fi-class'
);
$this->dsEditFormatterSettings($edit);
$this->drupalGet('node/' . $node->nid);
$this->assertRaw("
");
// With outer wrapper class and field items span wrapper and class.
$edit = array(
'fields[body][settings_edit_form][settings][ft][ow]' => '1',
'fields[body][settings_edit_form][settings][ft][ow-el]' => 'div',
'fields[body][settings_edit_form][settings][ft][ow-cl]' => 'ow-class',
'fields[body][settings_edit_form][settings][ft][fis]' => '1',
'fields[body][settings_edit_form][settings][ft][fis-el]' => 'span',
'fields[body][settings_edit_form][settings][ft][fis-cl]' => 'fi-class'
);
$this->dsEditFormatterSettings($edit);
$this->drupalGet('node/' . $node->nid);
$this->assertRaw("
");
// With outer wrapper span class and field items span wrapper and class.
$edit = array(
'fields[body][settings_edit_form][settings][ft][ow]' => '1',
'fields[body][settings_edit_form][settings][ft][ow-el]' => 'span',
'fields[body][settings_edit_form][settings][ft][ow-cl]' => 'ow-class',
'fields[body][settings_edit_form][settings][ft][fis]' => '1',
'fields[body][settings_edit_form][settings][ft][fis-el]' => 'span',
'fields[body][settings_edit_form][settings][ft][fis-cl]' => 'fi-class-2'
);
$this->dsEditFormatterSettings($edit);
$this->drupalGet('node/' . $node->nid);
$this->assertRaw("
");
// Clear field settings.
$this->entitiesClearFieldSettings();
// With field item div wrapper.
$edit = array(
'fields[body][settings_edit_form][settings][ft][func]' => 'theme_ds_field_expert',
'fields[body][settings_edit_form][settings][ft][fi]' => '1',
);
$this->dsEditFormatterSettings($edit);
$this->drupalGet('node/' . $node->nid);
$this->assertRaw("
");
// With field item span wrapper.
$edit = array(
'fields[body][settings_edit_form][settings][ft][fi]' => '1',
'fields[body][settings_edit_form][settings][ft][fi-el]' => 'span',
);
$this->dsEditFormatterSettings($edit);
$this->drupalGet('node/' . $node->nid);
$this->assertRaw("
");
// With field item span wrapper and class and odd even.
$edit = array(
'fields[body][settings_edit_form][settings][ft][fi]' => '1',
'fields[body][settings_edit_form][settings][ft][fi-el]' => 'span',
'fields[body][settings_edit_form][settings][ft][fi-cl]' => 'fi-class',
'fields[body][settings_edit_form][settings][ft][fi-odd-even]' => '1',
'fields[body][settings_edit_form][settings][ft][fi-first-last]' => '1',
);
$this->dsEditFormatterSettings($edit);
$this->drupalGet('node/' . $node->nid);
$this->assertRaw("
");
// With fis and fi.
$edit = array(
'fields[body][settings_edit_form][settings][ft][fis]' => '1',
'fields[body][settings_edit_form][settings][ft][fis-el]' => 'div',
'fields[body][settings_edit_form][settings][ft][fis-cl]' => 'fi-class-2',
'fields[body][settings_edit_form][settings][ft][fi]' => '1',
'fields[body][settings_edit_form][settings][ft][fi-el]' => 'div',
'fields[body][settings_edit_form][settings][ft][fi-cl]' => 'fi-class',
'fields[body][settings_edit_form][settings][ft][fi-odd-even]' => '1',
'fields[body][settings_edit_form][settings][ft][fi-first-last]' => '1',
);
$this->dsEditFormatterSettings($edit);
$this->drupalGet('node/' . $node->nid);
$this->assertRaw("
");
// With all wrappers.
$edit = array(
'fields[body][settings_edit_form][settings][ft][ow]' => '1',
'fields[body][settings_edit_form][settings][ft][ow-el]' => 'div',
'fields[body][settings_edit_form][settings][ft][ow-cl]' => 'ow-class',
'fields[body][settings_edit_form][settings][ft][fis]' => '1',
'fields[body][settings_edit_form][settings][ft][fis-el]' => 'div',
'fields[body][settings_edit_form][settings][ft][fis-cl]' => 'fi-class-2',
'fields[body][settings_edit_form][settings][ft][fi]' => '1',
'fields[body][settings_edit_form][settings][ft][fi-el]' => 'span',
'fields[body][settings_edit_form][settings][ft][fi-cl]' => 'fi-class',
'fields[body][settings_edit_form][settings][ft][fi-odd-even]' => '1',
'fields[body][settings_edit_form][settings][ft][fi-first-last]' => '1',
);
$this->dsEditFormatterSettings($edit);
$this->drupalGet('node/' . $node->nid);
$this->assertRaw("
");
// With all wrappers and attributes.
$edit = array(
'fields[body][settings_edit_form][settings][ft][ow]' => '1',
'fields[body][settings_edit_form][settings][ft][ow-el]' => 'div',
'fields[body][settings_edit_form][settings][ft][ow-cl]' => 'ow-class',
'fields[body][settings_edit_form][settings][ft][ow-at]' => 'name="ow-att"',
'fields[body][settings_edit_form][settings][ft][fis]' => '1',
'fields[body][settings_edit_form][settings][ft][fis-el]' => 'div',
'fields[body][settings_edit_form][settings][ft][fis-cl]' => 'fi-class-2',
'fields[body][settings_edit_form][settings][ft][fis-at]' => 'name="fis-att"',
'fields[body][settings_edit_form][settings][ft][fi]' => '1',
'fields[body][settings_edit_form][settings][ft][fi-el]' => 'span',
'fields[body][settings_edit_form][settings][ft][fi-cl]' => 'fi-class',
'fields[body][settings_edit_form][settings][ft][fi-at]' => 'name="fi-at"',
);
$this->dsEditFormatterSettings($edit);
$this->drupalGet('node/' . $node->nid);
$this->assertRaw("
");
// Remove attributes.
$edit = array(
'fields[body][settings_edit_form][settings][ft][ow]' => '1',
'fields[body][settings_edit_form][settings][ft][ow-el]' => 'div',
'fields[body][settings_edit_form][settings][ft][ow-cl]' => 'ow-class',
'fields[body][settings_edit_form][settings][ft][ow-at]' => '',
'fields[body][settings_edit_form][settings][ft][fis]' => '1',
'fields[body][settings_edit_form][settings][ft][fis-el]' => 'div',
'fields[body][settings_edit_form][settings][ft][fis-cl]' => 'fi-class-2',
'fields[body][settings_edit_form][settings][ft][fis-at]' => '',
'fields[body][settings_edit_form][settings][ft][fi]' => '1',
'fields[body][settings_edit_form][settings][ft][fi-el]' => 'span',
'fields[body][settings_edit_form][settings][ft][fi-cl]' => 'fi-class',
'fields[body][settings_edit_form][settings][ft][fi-at]' => '',
);
$this->dsEditFormatterSettings($edit);
// Label tests with custom function.
$this->entitiesSetLabelClass('above');
$this->drupalGet('node/' . $node->nid);
$this->assertRaw("
");
$this->entitiesSetLabelClass('inline');
$this->drupalGet('node/' . $node->nid);
$this->assertRaw("
");
$this->entitiesSetLabelClass('above', 'My body');
$this->drupalGet('node/' . $node->nid);
$this->assertRaw("
");
$this->entitiesSetLabelClass('inline', 'My body');
$this->drupalGet('node/' . $node->nid);
$this->assertRaw("
");
$this->entitiesSetLabelClass('inline', 'My body', '', TRUE);
$this->drupalGet('node/' . $node->nid);
$this->assertRaw("
");
$this->entitiesSetLabelClass('hidden');
$this->drupalGet('node/' . $node->nid);
$this->assertRaw("
");
// Test default classes on outer wrapper.
$edit = array(
'fields[body][settings_edit_form][settings][ft][ow]' => '1',
'fields[body][settings_edit_form][settings][ft][ow-el]' => 'div',
'fields[body][settings_edit_form][settings][ft][ow-cl]' => 'ow-class',
'fields[body][settings_edit_form][settings][ft][ow-def-cl]' => '1',
);
$this->dsEditFormatterSettings($edit);
$this->drupalGet('node/' . $node->nid);
$this->assertRaw("
");
// Test default attributes on field item.
$edit = array(
'fields[body][settings_edit_form][settings][ft][ow]' => '1',
'fields[body][settings_edit_form][settings][ft][ow-el]' => 'div',
'fields[body][settings_edit_form][settings][ft][ow-cl]' => 'ow-class',
'fields[body][settings_edit_form][settings][ft][ow-def-cl]' => '1',
'fields[body][settings_edit_form][settings][ft][fi-def-at]' => '1',
);
$this->dsEditFormatterSettings($edit);
$this->drupalGet('node/' . $node->nid);
$this->assertRaw("
");
// Use the test field theming function to test that this function is
// registered in the theme registry through ds_extras_theme().
$edit = array(
'fields[body][settings_edit_form][settings][ft][func]' => 'ds_test_theming_function',
);
$this->dsEditFormatterSettings($edit);
$this->drupalGet('node/' . $node->nid);
$this->assertRaw("
Testing field output through custom function
");
}
}