function autocompleteWidgetsBaseTest::createInstance in Autocomplete Widgets for Text and Number Fields 7
Adds an instance of the given field to the article content type.
4 calls to autocompleteWidgetsBaseTest::createInstance()
- autocompleteWidgetsAllowedValuesTest::testAllowedValues in tests/
autocomplete_widgets.test - autocompleteWidgetsFieldDataTest::testFieldData in tests/
autocomplete_widgets.test - autocompleteWidgetsNodeReferenceTest::testNodeTitles in tests/
autocomplete_widgets.test - autocompleteWidgetsSuggestedValuesTest::testSuggestedValues in tests/
autocomplete_widgets.test
File
- tests/
autocomplete_widgets.test, line 40
Class
Code
function createInstance($field, $widget_type, $settings) {
$instance = array(
'field_name' => $this->field['field_name'],
'entity_type' => 'node',
'bundle' => 'article',
'widget' => array(
'type' => $widget_type,
'settings' => $settings,
),
);
return field_create_instance($instance);
}