You are here

protected function FeedsMapperTestCase::selectFieldWidget in Feeds 7

Same name and namespace in other branches
  1. 6 tests/feeds_mapper.test \FeedsMapperTestCase::selectFieldWidget()
  2. 7.2 tests/feeds_mapper.test \FeedsMapperTestCase::selectFieldWidget()

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.

2 calls to FeedsMapperTestCase::selectFieldWidget()
FeedsMapperFileFieldTestCase::selectFieldWidget in tests/feeds_mapper_filefield.test
Handle file field widgets.
FeedsMapperTestCase::createContentType in tests/feeds_mapper_test.inc
Create a new content-type, and add a field to it. Mostly copied from cck/tests/content.crud.test ContentUICrud::testAddFieldUI
1 method overrides FeedsMapperTestCase::selectFieldWidget()
FeedsMapperFileFieldTestCase::selectFieldWidget in tests/feeds_mapper_filefield.test
Handle file field widgets.

File

tests/feeds_mapper_test.inc, line 161
Helper class with auxiliary functions for feeds mapper module tests.

Class

FeedsMapperTestCase
Base class for implementing Feeds Mapper test cases.

Code

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