function ViewsFieldApiTestHelper::setUpInstances

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 88

Class

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

Code

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