You are here

private function CCKFeedsMapperLocationTestCase::_location_cck_fields in Location Feeds 6

Helper function to add the location CCK fields

@param: $type - the node type object @param: $field_name - the field name to add @param: $settings - the field settings array

1 call to CCKFeedsMapperLocationTestCase::_location_cck_fields()
CCKFeedsMapperLocationTestCase::test in tests/location_feeds.cck.test
Basic test loading an RSS feed for nodes with CCK locations.

File

tests/location_feeds.cck.test, line 193

Class

CCKFeedsMapperLocationTestCase

Code

private function _location_cck_fields($type, $field_name, $settings) {
  $field_type = 'location';
  $field_widget = 'location';
  $label = $field_name . '_' . $field_type . '_label';
  $edit = array(
    '_add_new_field[label]' => $label,
    '_add_new_field[field_name]' => $field_name,
    '_add_new_field[type]' => $field_type,
    '_add_new_field[widget_type]' => $field_widget,
  );
  $this
    ->drupalPost('admin/content/node-type/' . $type->type . '/fields', $edit, 'Save');

  // (Default) Configure the field.
  $this
    ->drupalPost(NULL, $this
    ->flattenPostData($settings), 'Save field settings');
  $this
    ->assertText('Added field ' . $field_name);
}