You are here

protected function FeedsMapperTestCase::selectFieldWidget in Feeds 7.2

Same name and namespace in other branches
  1. 6 tests/feeds_mapper.test \FeedsMapperTestCase::selectFieldWidget()
  2. 7 tests/feeds_mapper_test.inc \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.

1 call to FeedsMapperTestCase::selectFieldWidget()
FeedsMapperTestCase::createContentType in tests/feeds_mapper.test
Create a new content-type, and add a field to it. Mostly copied from cck/tests/content.crud.test ContentUICrud::testAddFieldUI

File

tests/feeds_mapper.test, line 188
Contains FeedsMapperTestCase.

Class

FeedsMapperTestCase
Helper class with auxiliary functions for feeds mapper module tests.

Code

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