You are here

function ViewsFieldApiTestHelper::setUpInstances in Views (for Drupal 7) 7.3

1 call to ViewsFieldApiTestHelper::setUpInstances()
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 82
Tests the fieldapi integration of viewsdata.

Class

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

Code

function setUpInstances($bundle = 'page') {
  foreach ($this->fields as $key => $field) {
    $instance = array(
      'field_name' => $field['field_name'],
      'entity_type' => 'node',
      'bundle' => 'page',
    );
    $this->instances[$key] = field_create_instance($instance);
  }
}