You are here

protected function TestItemTest::setUp in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/field/src/Tests/TestItemTest.php \Drupal\field\Tests\TestItemTest::setUp()

Set the default field storage backend for fields created during tests.

Overrides FieldUnitTestBase::setUp

File

core/modules/field/src/Tests/TestItemTest.php, line 35
Contains \Drupal\field\Tests\TestItemTest.

Class

TestItemTest
Tests the new entity API for the test field type.

Namespace

Drupal\field\Tests

Code

protected function setUp() {
  parent::setUp();

  // Create a 'test_field' field and storage for validation.
  entity_create('field_storage_config', array(
    'field_name' => $this->fieldName,
    'entity_type' => 'entity_test',
    'type' => 'test_field',
  ))
    ->save();
  entity_create('field_config', array(
    'entity_type' => 'entity_test',
    'field_name' => $this->fieldName,
    'bundle' => 'entity_test',
  ))
    ->save();
}