function GeoFieldTestCase::_testGeofieldWidgets in Geofield 7
Helper function for testGeofieldWidgets().
1 call to GeoFieldTestCase::_testGeofieldWidgets()
- GeoFieldTestCase::testGeofieldWidgets in ./
geofield.test - Test widgets.
File
- ./
geofield.test, line 38 - Tests for geofield.module.
Class
- GeoFieldTestCase
- @file Tests for geofield.module.
Code
function _testGeofieldWidgets($widget_type) {
// Setup a field and instance
$entity_type = 'test_entity';
$this->field_name = drupal_strtolower($this
->randomName());
$this->field = array(
'field_name' => $this->field_name,
'type' => 'geofield',
);
field_create_field($this->field);
$this->instance = array(
'field_name' => $this->field_name,
'entity_type' => 'test_entity',
'bundle' => 'test_bundle',
'label' => $this
->randomName() . '_label',
'settings' => array(),
'widget' => array(
'type' => $widget_type,
),
'display' => array(
'full' => array(
'type' => 'geofield_wkt',
),
),
);
field_create_instance($this->instance);
$langcode = LANGUAGE_NONE;
// Display creation form.
$this
->drupalGet('test-entity/add/test-bundle');
$this
->assertFieldByName("{$this->field_name}[{$langcode}][0][wkt]", '', t('Widget is displayed'));
}