You are here

function FieldTestBase::setUpFields in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/field/src/Tests/Views/FieldTestBase.php \Drupal\field\Tests\Views\FieldTestBase::setUpFields()
2 calls to FieldTestBase::setUpFields()
FieldUITest::setUp in core/modules/field/src/Tests/Views/FieldUITest.php
Sets up a Drupal site for running functional and integration tests.
HandlerFieldFieldTest::setUp in core/modules/field/src/Tests/Views/HandlerFieldFieldTest.php
Sets up a Drupal site for running functional and integration tests.

File

core/modules/field/src/Tests/Views/FieldTestBase.php, line 79
Contains \Drupal\field\Tests\Views\FieldTestBase.

Class

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

Namespace

Drupal\field\Tests\Views

Code

function setUpFields($bundle = 'page') {
  foreach ($this->fieldStorages as $key => $field_storage) {
    $this->fields[$key] = entity_create('field_config', array(
      'field_storage' => $field_storage,
      'bundle' => $bundle,
    ));
    $this->fields[$key]
      ->save();
  }
}