You are here

function GeofieldBaseTestCase::_testGeoFieldAPISetup in Geofield 7.2

Helper function for testGeofieldWidgets().

7 calls to GeofieldBaseTestCase::_testGeoFieldAPISetup()
GeofieldFormatterTestCase::testGeofieldDefFormatter in tests/geofield.test
GeofieldFormatterTestCase::testGeofieldGeoJSONFormatter in tests/geofield.test
GeofieldFormatterTestCase::testGeofieldWKTFormatter in tests/geofield.test
GeofieldWidgetTestCase::testGeofieldFieldBoundsWidget in tests/geofield.test
Test Bounds Input.
GeofieldWidgetTestCase::testGeofieldFieldGeoJSONWidget in tests/geofield.test
Test GeoJSON Input.

... See full list

File

tests/geofield.test, line 20
Tests for geofield.module.

Class

GeofieldBaseTestCase
@file Tests for geofield.module.

Code

function _testGeoFieldAPISetup($widget_type, $display_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' => $display_type,
      ),
    ),
  );
  field_create_instance($this->instance);
}