You are here

protected function FeedsMapperLinkTest::getFormFieldsValues in Feeds 8.2

Override parent::getFormFieldsValues().

Overrides FeedsMapperTestBase::getFormFieldsValues

File

lib/Drupal/feeds/Tests/FeedsMapperLinkTest.php, line 152
Test case for CCK link mapper mappers/date.inc.

Class

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

Namespace

Drupal\feeds\Tests

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);
  }
}