function ViewsFieldApiTestHelper::setUpFields

2 calls to ViewsFieldApiTestHelper::setUpFields()
viewsFieldApiDataTest::setUp in tests/field/views_fieldapi.test
Sets up a Drupal site for running functional and integration tests.
viewsHandlerFieldFieldTest::setUp in tests/field/views_fieldapi.test
Sets up a Drupal site for running functional and integration tests.

File

tests/field/views_fieldapi.test, line 73

Class

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

Code

public 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;
}