1 field_views.test FieldViewsTestHelper::setUpFields($amount = 3)

File

core/modules/field/tests/field_views.test, line 65
Tests the Views integration with Field API.

Class

FieldViewsTestHelper
Provides some helper methods for testing fieldapi integration into views.

Code

function setUpFields($amount = 3) {
  // Create three fields.
  $field_names = array();
  for ($i = 0; $i < $amount; $i++) {
    $field_names[$i] = 'field_name_' . $i;
    $field = array('field_name' => $field_names[$i], 'type' => 'text');

    $this->fields[$i] = $field = field_create_field($field);
  }
  return $field_names;
}