You are here

protected function FeedsMapperLinkTestCase::getFormFieldsValues in Feeds 7

Same name and namespace in other branches
  1. 6 tests/feeds_mapper_link.test \FeedsMapperLinkTestCase::getFormFieldsValues()
  2. 7.2 tests/feeds_mapper_link.test \FeedsMapperLinkTestCase::getFormFieldsValues()

Override parent::getFormFieldsValues().

Overrides FeedsMapperTestCase::getFormFieldsValues

File

tests/feeds_mapper_link.test, line 164

Class

FeedsMapperLinkTestCase
Class for testing Feeds <em>link</em> mapper.

Code

protected function getFormFieldsValues($field_name, $value) {
  $field = content_fields($field_name);
  if (in_array($field_name, array(
    'alpha',
    'beta',
    'gamma',
    'omega',
  ))) {
    if (!is_array($value)) {
      $value = array(
        'url' => $value,
      );
    }
    $values = array(
      $value['url'],
    );
    if (in_array($field_name, array(
      'alpha',
      'gamma',
    ))) {
      $values[] = isset($value['title']) ? $value['title'] : '';
    }
    return $values;
  }
  else {
    return parent::getFormFieldsValues($field_name, $index);
  }
}