function ViewsFieldApiTestHelper::setUpInstances

3.x views_fieldapi.test ViewsFieldApiTestHelper::setUpInstances($bundle = 'page')
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 75
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);
  }
}