You are here

protected function FeedsMapperLinkTestCase::getFormFieldsValues in Feeds 7.2

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

Override parent::getFormFieldsValues().

Overrides FeedsMapperTestCase::getFormFieldsValues

File

tests/feeds_mapper_link.test, line 381
Contains FeedsMapperLinkTestCase.

Class

FeedsMapperLinkTestCase
Test case for CCK link mapper mappers/date.inc.

Code

protected function getFormFieldsValues($field_name, $value) {
  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);
  }
}