You are here

public function ExifFunctionalTestCase::addNewFieldToContentType in Exif 7

1 call to ExifFunctionalTestCase::addNewFieldToContentType()
ExifFunctionalTestCase::setUp in ./exif_functionaltests.php
Sets up a Drupal site for running functional and integration tests.

File

./exif_functionaltests.php, line 71

Class

ExifFunctionalTestCase

Code

public function addNewFieldToContentType($contenttype, $fieldLabel, $fieldName, $fieldType, $fieldWidget, $fieldSettings = array(), $settings = array()) {
  $edit = array();
  $edit["fields[_add_new_field][label]"] = $fieldLabel;
  $edit["fields[_add_new_field][field_name]"] = $fieldName;
  $edit["fields[_add_new_field][type]"] = $fieldType;
  $edit["fields[_add_new_field][widget_type]"] = $fieldWidget;
  $this
    ->drupalPost("admin/structure/types/manage/{$contenttype->type}/fields", $edit, t("Save"));
  $this
    ->drupalPost(NULL, $fieldSettings, "Save field settings");
  $this
    ->drupalPost(NULL, $settings, "Save settings");
}