You are here

protected function TelephoneItemTest::setUp in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 core/modules/telephone/src/Tests/TelephoneItemTest.php \Drupal\telephone\Tests\TelephoneItemTest::setUp()

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

Overrides FieldUnitTestBase::setUp

File

core/modules/telephone/src/Tests/TelephoneItemTest.php, line 28
Contains \Drupal\telephone\Tests\TelephoneItemTest.

Class

TelephoneItemTest
Tests the new entity API for the telephone field type.

Namespace

Drupal\telephone\Tests

Code

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

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