You are here

public function ExifFunctionalTestCase::manageDisplay in Exif 7

File

./exif_functionaltests.php, line 93

Class

ExifFunctionalTestCase

Code

public function manageDisplay($contenttype, $fieldName, $label = 'hidden', $format = 'hidden', $displays = array(
  'full',
  'teaser',
)) {
  $edit = array();

  //accepted values are : above, inline, hidden
  $edit["fields[field_{$fieldName}][label]"] = $label;

  //accepted values for term are : taxonomy_term_reference_link, taxonomy_term_reference_plain, hidden

  //accepted value for text are : text_plain, hidden
  $edit["fields[field_{$fieldName}][type]"] = $format;
  foreach ($displays as $key => $display) {
    $edit["view_modes_custom[{$display}]"] = $display;
  }
  $this
    ->drupalPost("admin/structure/types/manage/{$contenttype->type}/display", $edit, t("Save"));
}