Helper function to create list field of a given type.
string $type: 'list_integer', 'list_float', 'list_text' or 'list_boolean'
protected function createOptionsField($type) {
// Create a test field and instance.
$field = array(
'field_name' => $this->field_name,
'type' => $type,
);
field_create_field($field);
$instance = array(
'field_name' => $this->field_name,
'entity_type' => 'node',
'bundle' => $this->type,
);
field_create_instance($instance);
$this->admin_path = 'admin/structure/types/manage/' . $this->type . '/fields/' . $this->field_name;
}