You are here

protected function FeedsMapperTestBase::selectFieldWidget in Feeds 8.2

Select the widget for the field. Default implementation provides widgets for Date, Number, Text, Node reference, User reference, Email, Emfield, Filefield, Image, and Link.

Extracted as a method to allow test implementations to add widgets for the tested CCK field type(s). $field_name allow to test the same field type with different widget (is this useful ?)

Parameters

$field_name: The name of the field.

$field_type: The CCK type of the field.

Return value

The widget for this field, or NULL if the field_type is not supported by this test class.

1 call to FeedsMapperTestBase::selectFieldWidget()
FeedsMapperTestBase::createContentType in lib/Drupal/feeds/Tests/FeedsMapperTestBase.php
Create a new content-type, and add a field to it. Mostly copied from cck/tests/content.crud.test ContentUICrud::testAddFieldUI

File

lib/Drupal/feeds/Tests/FeedsMapperTestBase.php, line 154
Helper class with auxiliary functions for feeds mapper module tests.

Class

FeedsMapperTestBase
Base class for implementing Feeds Mapper test cases.

Namespace

Drupal\feeds\Tests

Code

protected function selectFieldWidget($field_name, $field_type) {
  $field_widgets = FeedsMapperTestBase::$field_widgets;
  return isset($field_widgets[$field_type]) ? $field_widgets[$field_type] : NULL;
}