You are here

protected function EFQViewsTestBase::saveFieldsEntities in EntityFieldQuery Views Backend 7

2 calls to EFQViewsTestBase::saveFieldsEntities()
EFQViewsTermTestCase::setUp in tests/efq_views.test
Sets up a Drupal site for running functional and integration tests.
EFQViewsTestBase::setUp in tests/efq_views.test
Sets up a Drupal site for running functional and integration tests.

File

tests/efq_views.test, line 43
Tests for EFQ Views query features.

Class

EFQViewsTestBase
Abstract class for EFQ views testing.

Code

protected function saveFieldsEntities() {
  foreach ($this->fields as $field) {
    field_create_field($field);
  }
  foreach ($this->instances as $instance) {
    field_create_instance($instance);
  }

  // Load the test dataset.
  foreach ($this->entities_array as $key => $entity_array) {
    $entity = entity_create('efq_views_test', $entity_array);
    entity_save('efq_views_test', $entity);
    $this
      ->assertFalse(empty($entity->eid), 'Entity saved');
    $this->entities[$key] = $entity;
  }
}