From 8ebe7038c647697f6569c51b0c27ec7f8e5b25f3 Mon Sep 17 00:00:00 2001
From: Mac_Weber <Mac_Weber@789986.no-reply.drupal.org>
Date: Mon, 28 Dec 2015 23:43:18 -0200
Subject: [PATCH] Issue #2641584 by Mac_Weber: Replace deprecated usage of
 entity_create('field_config') with a direct call to FieldConfig::create()

---
 core/modules/block_content/block_content.module    |  2 +-
 .../config/src/Tests/ConfigExportImportUITest.php  |  2 +-
 .../src/Tests/ConfigTranslationListUiTest.php      |  3 ++-
 .../contact/src/Tests/Views/ContactFieldsTest.php  |  3 ++-
 .../ContentTranslationContextualLinksTest.php      |  3 ++-
 .../src/Tests/ContentTranslationSyncImageTest.php  |  3 ++-
 .../src/Tests/ContentTranslationTestBase.php       |  3 ++-
 .../datetime/src/Tests/DateTimeFieldTest.php       |  5 +++--
 .../datetime/src/Tests/DateTimeItemTest.php        |  3 ++-
 .../src/Tests/Views/DateTimeHandlerTestBase.php    |  3 ++-
 core/modules/field/src/Entity/FieldConfig.php      |  3 ++-
 .../field/src/Tests/Boolean/BooleanItemTest.php    |  3 ++-
 core/modules/field/src/Tests/BulkDeleteTest.php    |  2 +-
 core/modules/field/src/Tests/DisplayApiTest.php    |  3 ++-
 .../field/src/Tests/Email/EmailFieldTest.php       |  3 ++-
 .../field/src/Tests/Email/EmailItemTest.php        |  3 ++-
 .../EntityReferenceAutoCreateTest.php              |  3 ++-
 .../EntityReferenceFieldDefaultValueTest.php       |  5 +++--
 ...tyReferenceFieldTranslatedReferenceViewTest.php |  3 ++-
 .../EntityReferenceFileUploadTest.php              |  5 +++--
 .../EntityReferenceFormatterTest.php               |  3 ++-
 .../Tests/EntityReference/Views/SelectionTest.php  |  3 ++-
 core/modules/field/src/Tests/FieldAccessTest.php   |  4 +++-
 .../field/src/Tests/FieldAttachStorageTest.php     |  8 +++----
 core/modules/field/src/Tests/FieldCrudTest.php     | 26 +++++++++++-----------
 .../modules/field/src/Tests/FieldDataCountTest.php |  2 +-
 .../src/Tests/FieldImportDeleteUninstallTest.php   |  8 ++++---
 .../src/Tests/FieldImportDeleteUninstallUiTest.php |  6 +++--
 .../field/src/Tests/FieldStorageCrudTest.php       | 10 ++++-----
 core/modules/field/src/Tests/FieldUnitTestBase.php |  3 ++-
 core/modules/field/src/Tests/FormTest.php          | 24 ++++++++++----------
 core/modules/field/src/Tests/NestedFormTest.php    |  5 +++--
 .../field/src/Tests/Number/NumberFieldTest.php     | 15 +++++++------
 .../field/src/Tests/Number/NumberItemTest.php      |  3 ++-
 core/modules/field/src/Tests/ShapeItemTest.php     |  3 ++-
 .../field/src/Tests/String/StringFieldTest.php     |  3 ++-
 core/modules/field/src/Tests/TestItemTest.php      |  3 ++-
 .../src/Tests/TestItemWithDependenciesTest.php     |  4 +++-
 core/modules/field/src/Tests/TranslationTest.php   |  5 +++--
 .../modules/field/src/Tests/TranslationWebTest.php |  2 +-
 .../field/src/Tests/Views/FieldTestBase.php        |  3 ++-
 .../field/src/Tests/reEnableModuleFieldTest.php    |  3 ++-
 core/modules/file/src/Tests/FileFieldTestBase.php  |  2 +-
 core/modules/file/src/Tests/FileItemTest.php       |  2 +-
 .../Tests/Views/RelationshipUserFileDataTest.php   |  3 ++-
 core/modules/hal/src/Tests/NormalizerTestBase.php  |  8 ++++---
 .../src/Tests/ImageFieldDefaultImagesTest.php      |  5 +++--
 .../modules/image/src/Tests/ImageFieldTestBase.php |  3 ++-
 core/modules/image/src/Tests/ImageItemTest.php     |  3 ++-
 .../image/src/Tests/ImageThemeFunctionTest.php     |  3 ++-
 .../Tests/Views/RelationshipUserImageDataTest.php  |  3 ++-
 .../src/Entity/ContentLanguageSettings.php         |  3 ++-
 core/modules/link/src/Tests/LinkFieldTest.php      |  9 ++++----
 core/modules/node/node.module                      |  2 +-
 .../Tests/MultiStepNodeFormBasicOptionsTest.php    |  3 ++-
 .../modules/node/src/Tests/NodeAccessFieldTest.php |  3 ++-
 .../NodeAccessLanguageAwareCombinationTest.php     |  3 ++-
 .../node/src/Tests/NodeAccessLanguageAwareTest.php |  3 ++-
 .../src/Tests/OptionsDynamicValuesTestBase.php     |  3 ++-
 .../modules/options/src/Tests/OptionsFieldTest.php |  3 ++-
 .../options/src/Tests/OptionsFieldUITest.php       |  3 ++-
 .../options/src/Tests/OptionsFieldUnitTestBase.php |  3 ++-
 .../options/src/Tests/OptionsWidgetsTest.php       | 11 ++++-----
 .../options/src/Tests/Views/ViewsDataTest.php      |  4 +++-
 .../quickedit/src/Tests/QuickEditTestBase.php      |  3 ++-
 .../rdf/src/Tests/Field/FieldRdfaTestBase.php      |  3 ++-
 .../serialization/src/Tests/EntityResolverTest.php |  3 ++-
 .../simpletest/src/Tests/KernelTestBaseTest.php    |  3 ++-
 .../system/src/Tests/Ajax/MultiFormTest.php        |  3 ++-
 .../src/Tests/Entity/EntityCacheTagsTestBase.php   |  4 ++--
 .../src/Tests/Entity/EntityLanguageTestBase.php    |  4 ++--
 .../src/Tests/Entity/EntityQueryAggregateTest.php  |  4 +++-
 .../system/src/Tests/Entity/EntityQueryTest.php    |  4 ++--
 .../EntityReferenceSelectionSortTest.php           |  3 ++-
 .../src/Tests/Entity/FieldSqlStorageTest.php       |  9 ++++----
 .../system/src/Tests/Form/ArbitraryRebuildTest.php |  3 ++-
 core/modules/system/src/Tests/Form/RebuildTest.php |  3 ++-
 .../tests/modules/entity_test/entity_test.install  |  3 ++-
 .../taxonomy/src/Tests/TaxonomyImageTest.php       |  3 ++-
 .../src/Tests/Views/TaxonomyFieldFilterTest.php    |  3 ++-
 .../taxonomy/src/Tests/VocabularyCrudTest.php      |  5 +++--
 .../telephone/src/Tests/TelephoneFieldTest.php     |  3 ++-
 .../telephone/src/Tests/TelephoneItemTest.php      |  3 ++-
 .../text/src/Tests/Formatter/TextFormatterTest.php |  3 ++-
 core/modules/text/src/Tests/TextFieldTest.php      |  9 ++++----
 .../text/src/Tests/TextWithSummaryItemTest.php     |  3 ++-
 core/modules/user/src/Tests/UserCreateTest.php     |  3 ++-
 .../user/src/Tests/UserRegistrationTest.php        |  2 +-
 .../Tests/Entity/ViewEntityDependenciesTest.php    |  5 +++--
 core/modules/views/src/Tests/FieldApiDataTest.php  |  2 +-
 .../views/src/Tests/Handler/FieldGroupRowsTest.php |  3 ++-
 .../views/src/Tests/Wizard/TaggedWithTest.php      |  3 ++-
 92 files changed, 239 insertions(+), 157 deletions(-)

diff --git a/core/modules/block_content/block_content.module b/core/modules/block_content/block_content.module
index 74fe9f1..f225df7 100644
--- a/core/modules/block_content/block_content.module
+++ b/core/modules/block_content/block_content.module
@@ -79,7 +79,7 @@ function block_content_add_body_field($block_type_id, $label = 'Body') {
   // Add or remove the body field, as needed.
   $field = FieldConfig::loadByName('block_content', $block_type_id, 'body');
   if (empty($field)) {
-    $field = entity_create('field_config', array(
+    $field = FieldConfig::create(array(
       'field_storage' =>  FieldStorageConfig::loadByName('block_content', 'body'),
       'bundle' => $block_type_id,
       'label' => $label,
diff --git a/core/modules/config/src/Tests/ConfigExportImportUITest.php b/core/modules/config/src/Tests/ConfigExportImportUITest.php
index d72c718..599a4ad 100644
--- a/core/modules/config/src/Tests/ConfigExportImportUITest.php
+++ b/core/modules/config/src/Tests/ConfigExportImportUITest.php
@@ -114,7 +114,7 @@ public function testExportImport() {
       'type' => 'text',
     ));
     $this->fieldStorage->save();
-    entity_create('field_config', array(
+    FieldConfig::create(array(
       'field_storage' => $this->fieldStorage,
       'bundle' => $this->contentType->id(),
     ))->save();
diff --git a/core/modules/config_translation/src/Tests/ConfigTranslationListUiTest.php b/core/modules/config_translation/src/Tests/ConfigTranslationListUiTest.php
index fceb41d..df30ed8 100644
--- a/core/modules/config_translation/src/Tests/ConfigTranslationListUiTest.php
+++ b/core/modules/config_translation/src/Tests/ConfigTranslationListUiTest.php
@@ -11,6 +11,7 @@
 use Drupal\field\Entity\FieldStorageConfig;
 use Drupal\language\Entity\ConfigurableLanguage;
 use Drupal\simpletest\WebTestBase;
+use Drupal\field\Entity\FieldConfig;
 
 /**
  * Visit all lists.
@@ -397,7 +398,7 @@ public function doFieldListTest() {
       'revision' => FALSE
     ));
     $block_content_type->save();
-    $field = entity_create('field_config', array(
+    $field = FieldConfig::create(array(
       // The field storage is guaranteed to exist because it is supplied by the
       // block_content module.
       'field_storage' => FieldStorageConfig::loadByName('block_content', 'body'),
diff --git a/core/modules/contact/src/Tests/Views/ContactFieldsTest.php b/core/modules/contact/src/Tests/Views/ContactFieldsTest.php
index 014e968..c2c4d10 100644
--- a/core/modules/contact/src/Tests/Views/ContactFieldsTest.php
+++ b/core/modules/contact/src/Tests/Views/ContactFieldsTest.php
@@ -8,6 +8,7 @@
 namespace Drupal\contact\Tests\Views;
 
 use Drupal\views\Tests\ViewTestBase;
+use Drupal\field\Entity\FieldConfig;
 
 /**
  * Tests which checks that no fieldapi fields are added on contact.
@@ -45,7 +46,7 @@ protected function setUp() {
       'label' => 'Test contact form',
     ))->save();
 
-    entity_create('field_config', array(
+    FieldConfig::create(array(
       'field_storage' => $this->fieldStorage,
       'bundle' => 'contact_message',
     ))->save();
diff --git a/core/modules/content_translation/src/Tests/ContentTranslationContextualLinksTest.php b/core/modules/content_translation/src/Tests/ContentTranslationContextualLinksTest.php
index edccaf0..1c2e97b 100644
--- a/core/modules/content_translation/src/Tests/ContentTranslationContextualLinksTest.php
+++ b/core/modules/content_translation/src/Tests/ContentTranslationContextualLinksTest.php
@@ -11,6 +11,7 @@
 use Drupal\language\Entity\ConfigurableLanguage;
 use Drupal\node\Entity\NodeType;
 use Drupal\simpletest\WebTestBase;
+use Drupal\field\Entity\FieldConfig;
 
 /**
  * Tests that contextual links are available for content translation.
@@ -78,7 +79,7 @@ protected function setUp() {
       'type' => 'text',
       'cardinality' => 1,
     ))->save();
-    entity_create('field_config', array(
+    FieldConfig::create(array(
       'entity_type' => 'node',
       'field_name' => 'field_test_text',
       'bundle' => $this->bundle,
diff --git a/core/modules/content_translation/src/Tests/ContentTranslationSyncImageTest.php b/core/modules/content_translation/src/Tests/ContentTranslationSyncImageTest.php
index 56b1ed5..0b586d9 100644
--- a/core/modules/content_translation/src/Tests/ContentTranslationSyncImageTest.php
+++ b/core/modules/content_translation/src/Tests/ContentTranslationSyncImageTest.php
@@ -8,6 +8,7 @@
 namespace Drupal\content_translation\Tests;
 
 use Drupal\Core\Entity\EntityInterface;
+use Drupal\field\Entity\FieldConfig;
 
 /**
  * Tests the field synchronization behavior for the image field.
@@ -56,7 +57,7 @@ protected function setupTestFields() {
       'cardinality' => $this->cardinality,
     ))->save();
 
-    entity_create('field_config', array(
+    FieldConfig::create(array(
       'entity_type' => $this->entityTypeId,
       'field_name' => $this->fieldName,
       'bundle' => $this->entityTypeId,
diff --git a/core/modules/content_translation/src/Tests/ContentTranslationTestBase.php b/core/modules/content_translation/src/Tests/ContentTranslationTestBase.php
index d00b378..dc211ba 100644
--- a/core/modules/content_translation/src/Tests/ContentTranslationTestBase.php
+++ b/core/modules/content_translation/src/Tests/ContentTranslationTestBase.php
@@ -10,6 +10,7 @@
 use Drupal\Core\Entity\Sql\SqlContentEntityStorage;
 use Drupal\language\Entity\ConfigurableLanguage;
 use Drupal\simpletest\WebTestBase;
+use Drupal\field\Entity\FieldConfig;
 
 /**
  * Base class for content translation tests.
@@ -189,7 +190,7 @@ protected function setupTestFields() {
       'entity_type' => $this->entityTypeId,
       'cardinality' => 1,
     ))->save();
-    entity_create('field_config', array(
+    FieldConfig::create(array(
       'entity_type' => $this->entityTypeId,
       'field_name' => $this->fieldName,
       'bundle' => $this->bundle,
diff --git a/core/modules/datetime/src/Tests/DateTimeFieldTest.php b/core/modules/datetime/src/Tests/DateTimeFieldTest.php
index 14ad190..06f7fc4 100644
--- a/core/modules/datetime/src/Tests/DateTimeFieldTest.php
+++ b/core/modules/datetime/src/Tests/DateTimeFieldTest.php
@@ -12,6 +12,7 @@
 use Drupal\Core\Entity\Entity\EntityViewDisplay;
 use Drupal\Core\Datetime\DrupalDateTime;
 use Drupal\simpletest\WebTestBase;
+use Drupal\field\Entity\FieldConfig;
 
 /**
  * Tests Datetime field functionality.
@@ -84,7 +85,7 @@ protected function setUp() {
       'settings' => array('datetime_type' => 'date'),
     ));
     $this->fieldStorage->save();
-    $this->field = entity_create('field_config', array(
+    $this->field = FieldConfig::create(array(
       'field_storage' => $this->fieldStorage,
       'bundle' => 'entity_test',
       'required' => TRUE,
@@ -632,7 +633,7 @@ function testDefaultValue() {
     ));
     $field_storage->save();
 
-    $field = entity_create('field_config', array(
+    $field = FieldConfig::create(array(
       'field_storage' => $field_storage,
       'bundle' => 'date_content',
     ));
diff --git a/core/modules/datetime/src/Tests/DateTimeItemTest.php b/core/modules/datetime/src/Tests/DateTimeItemTest.php
index d83d2a2..eae6df4 100644
--- a/core/modules/datetime/src/Tests/DateTimeItemTest.php
+++ b/core/modules/datetime/src/Tests/DateTimeItemTest.php
@@ -10,6 +10,7 @@
 use Drupal\Core\Field\FieldItemListInterface;
 use Drupal\Core\Field\FieldItemInterface;
 use Drupal\field\Tests\FieldUnitTestBase;
+use Drupal\field\Entity\FieldConfig;
 
 /**
  * Tests the new entity API for the date field type.
@@ -36,7 +37,7 @@ protected function setUp() {
       'settings' => array('datetime_type' => 'date'),
     ));
     $field_storage->save();
-    $field = entity_create('field_config', array(
+    $field = FieldConfig::create(array(
       'field_storage' => $field_storage,
       'bundle' => 'entity_test',
       'settings' => array(
diff --git a/core/modules/datetime/src/Tests/Views/DateTimeHandlerTestBase.php b/core/modules/datetime/src/Tests/Views/DateTimeHandlerTestBase.php
index b9a4699..5cf48ab 100644
--- a/core/modules/datetime/src/Tests/Views/DateTimeHandlerTestBase.php
+++ b/core/modules/datetime/src/Tests/Views/DateTimeHandlerTestBase.php
@@ -10,6 +10,7 @@
 use Drupal\datetime\Plugin\Field\FieldType\DateTimeItem;
 use Drupal\views\Tests\Handler\HandlerTestBase;
 use Drupal\views\Tests\ViewTestData;
+use Drupal\field\Entity\FieldConfig;
 
 /**
  * Base class for testing datetime handlers.
@@ -56,7 +57,7 @@ public function setUp() {
       'settings' => ['datetime_type' => DateTimeItem::DATETIME_TYPE_DATETIME],
     ]);
     $fieldStorage->save();
-    $field = entity_create('field_config', [
+    $field = FieldConfig::create([
       'field_storage' => $fieldStorage,
       'bundle' => 'page',
       'required' => TRUE,
diff --git a/core/modules/field/src/Entity/FieldConfig.php b/core/modules/field/src/Entity/FieldConfig.php
index 8e0e0b4..e56ca7b 100644
--- a/core/modules/field/src/Entity/FieldConfig.php
+++ b/core/modules/field/src/Entity/FieldConfig.php
@@ -12,6 +12,7 @@
 use Drupal\Core\Field\FieldException;
 use Drupal\field\FieldStorageConfigInterface;
 use Drupal\field\FieldConfigInterface;
+use Drupal\field\Entity\FieldConfig;
 
 /**
  * Defines the Field entity.
@@ -72,7 +73,7 @@ class FieldConfig extends FieldConfigBase implements FieldConfigInterface {
    * Constructs a FieldConfig object.
    *
    * In most cases, Field entities are created via
-   * entity_create('field_config', $values), where $values is the same
+   * FieldConfig::create($values), where $values is the same
    * parameter as in this constructor.
    *
    * @param array $values
diff --git a/core/modules/field/src/Tests/Boolean/BooleanItemTest.php b/core/modules/field/src/Tests/Boolean/BooleanItemTest.php
index e9d7605..72db1e6 100644
--- a/core/modules/field/src/Tests/Boolean/BooleanItemTest.php
+++ b/core/modules/field/src/Tests/Boolean/BooleanItemTest.php
@@ -10,6 +10,7 @@
 use Drupal\Core\Field\FieldItemListInterface;
 use Drupal\Core\Field\FieldItemInterface;
 use Drupal\field\Tests\FieldUnitTestBase;
+use Drupal\field\Entity\FieldConfig;
 
 /**
  * Tests the new entity API for the boolean field type.
@@ -30,7 +31,7 @@ protected function setUp() {
       'entity_type' => 'entity_test',
       'type' => 'boolean',
     ))->save();
-    entity_create('field_config', array(
+    FieldConfig::create(array(
       'entity_type' => 'entity_test',
       'field_name' => 'field_boolean',
       'bundle' => 'entity_test',
diff --git a/core/modules/field/src/Tests/BulkDeleteTest.php b/core/modules/field/src/Tests/BulkDeleteTest.php
index d7e1aca..d3c41ca 100644
--- a/core/modules/field/src/Tests/BulkDeleteTest.php
+++ b/core/modules/field/src/Tests/BulkDeleteTest.php
@@ -126,7 +126,7 @@ protected function setUp() {
     // fields.
     foreach ($this->bundles as $bundle) {
       foreach ($this->fieldStorages as $field_storage) {
-        entity_create('field_config', array(
+        FieldConfig::create(array(
           'field_storage' => $field_storage,
           'bundle' => $bundle,
         ))->save();
diff --git a/core/modules/field/src/Tests/DisplayApiTest.php b/core/modules/field/src/Tests/DisplayApiTest.php
index eff812b..028f5e6 100644
--- a/core/modules/field/src/Tests/DisplayApiTest.php
+++ b/core/modules/field/src/Tests/DisplayApiTest.php
@@ -8,6 +8,7 @@
 namespace Drupal\field\Tests;
 
 use Drupal\Core\Entity\Entity\EntityViewMode;
+use Drupal\field\Entity\FieldConfig;
 
 /**
  * Tests the field display API.
@@ -95,7 +96,7 @@ protected function setUp() {
     );
 
     entity_create('field_storage_config', $field_storage)->save();
-    entity_create('field_config', $field)->save();
+    FieldConfig::create($field)->save();
     // Create a display for the default view mode.
     entity_get_display($field['entity_type'], $field['bundle'], 'default')
       ->setComponent($this->fieldName, $this->displayOptions['default'])
diff --git a/core/modules/field/src/Tests/Email/EmailFieldTest.php b/core/modules/field/src/Tests/Email/EmailFieldTest.php
index b916ed0..99cdd2e 100644
--- a/core/modules/field/src/Tests/Email/EmailFieldTest.php
+++ b/core/modules/field/src/Tests/Email/EmailFieldTest.php
@@ -9,6 +9,7 @@
 
 use Drupal\Component\Utility\Unicode;
 use Drupal\simpletest\WebTestBase;
+use Drupal\field\Entity\FieldConfig;
 
 /**
  * Tests email field functionality.
@@ -60,7 +61,7 @@ function testEmailField() {
       'type' => 'email',
     ));
     $this->fieldStorage->save();
-    $this->field = entity_create('field_config', array(
+    $this->field = FieldConfig::create(array(
       'field_storage' => $this->fieldStorage,
       'bundle' => 'entity_test',
     ));
diff --git a/core/modules/field/src/Tests/Email/EmailItemTest.php b/core/modules/field/src/Tests/Email/EmailItemTest.php
index b6a148f..da8e304 100644
--- a/core/modules/field/src/Tests/Email/EmailItemTest.php
+++ b/core/modules/field/src/Tests/Email/EmailItemTest.php
@@ -10,6 +10,7 @@
 use Drupal\Core\Field\FieldItemListInterface;
 use Drupal\Core\Field\FieldItemInterface;
 use Drupal\field\Tests\FieldUnitTestBase;
+use Drupal\field\Entity\FieldConfig;
 
 /**
  * Tests the new entity API for the email field type.
@@ -27,7 +28,7 @@ protected function setUp() {
       'entity_type' => 'entity_test',
       'type' => 'email',
     ))->save();
-    entity_create('field_config', array(
+    FieldConfig::create(array(
       'entity_type' => 'entity_test',
       'field_name' => 'field_email',
       'bundle' => 'entity_test',
diff --git a/core/modules/field/src/Tests/EntityReference/EntityReferenceAutoCreateTest.php b/core/modules/field/src/Tests/EntityReference/EntityReferenceAutoCreateTest.php
index 77bede9..f9d6945 100644
--- a/core/modules/field/src/Tests/EntityReference/EntityReferenceAutoCreateTest.php
+++ b/core/modules/field/src/Tests/EntityReference/EntityReferenceAutoCreateTest.php
@@ -10,6 +10,7 @@
 use Drupal\Core\Field\FieldStorageDefinitionInterface;
 use Drupal\simpletest\WebTestBase;
 use Drupal\node\Entity\Node;
+use Drupal\field\Entity\FieldConfig;
 
 /**
  * Tests creating new entity (e.g. taxonomy-term) from an autocomplete widget.
@@ -56,7 +57,7 @@ protected function setUp() {
       'cardinality' => FieldStorageDefinitionInterface::CARDINALITY_UNLIMITED,
     ))->save();
 
-    entity_create('field_config', array(
+    FieldConfig::create(array(
       'label' => 'Entity reference field',
       'field_name' => 'test_field',
       'entity_type' => 'node',
diff --git a/core/modules/field/src/Tests/EntityReference/EntityReferenceFieldDefaultValueTest.php b/core/modules/field/src/Tests/EntityReference/EntityReferenceFieldDefaultValueTest.php
index ae6fec7..e276955 100644
--- a/core/modules/field/src/Tests/EntityReference/EntityReferenceFieldDefaultValueTest.php
+++ b/core/modules/field/src/Tests/EntityReference/EntityReferenceFieldDefaultValueTest.php
@@ -11,6 +11,7 @@
 use Drupal\config\Tests\SchemaCheckTestTrait;
 use Drupal\field\Entity\FieldStorageConfig;
 use Drupal\simpletest\WebTestBase;
+use Drupal\field\Entity\FieldConfig;
 
 /**
  * Tests entity reference field default values storage in CMI.
@@ -62,7 +63,7 @@ function testEntityReferenceDefaultValue() {
       'settings' => array('target_type' => 'node'),
     ));
     $field_storage->save();
-    $field = entity_create('field_config', array(
+    $field = FieldConfig::create(array(
       'field_storage' => $field_storage,
       'bundle' => 'reference_content',
       'settings' => array(
@@ -126,7 +127,7 @@ function testEntityReferenceDefaultConfigValue() {
       'cardinality' => FieldStorageConfig::CARDINALITY_UNLIMITED,
     ));
     $field_storage->save();
-    $field = entity_create('field_config', array(
+    $field = FieldConfig::create(array(
       'field_storage' => $field_storage,
       'bundle' => 'reference_content',
       'settings' => array(
diff --git a/core/modules/field/src/Tests/EntityReference/EntityReferenceFieldTranslatedReferenceViewTest.php b/core/modules/field/src/Tests/EntityReference/EntityReferenceFieldTranslatedReferenceViewTest.php
index 7b3568c..77ee931 100644
--- a/core/modules/field/src/Tests/EntityReference/EntityReferenceFieldTranslatedReferenceViewTest.php
+++ b/core/modules/field/src/Tests/EntityReference/EntityReferenceFieldTranslatedReferenceViewTest.php
@@ -10,6 +10,7 @@
 use Drupal\language\Entity\ConfigurableLanguage;
 use Drupal\Core\Field\FieldStorageDefinitionInterface;
 use Drupal\simpletest\WebTestBase;
+use Drupal\field\Entity\FieldConfig;
 
 /**
  * Tests the translation of entity reference field display on nodes.
@@ -221,7 +222,7 @@ protected function setUpEntityReferenceField() {
       ),
     ))->save();
 
-    entity_create('field_config', array(
+    FieldConfig::create(array(
       'field_name' => $this->referenceFieldName,
       'bundle' => $this->referrerType->id(),
       'entity_type' => $this->testEntityTypeName,
diff --git a/core/modules/field/src/Tests/EntityReference/EntityReferenceFileUploadTest.php b/core/modules/field/src/Tests/EntityReference/EntityReferenceFileUploadTest.php
index eb9f640..6c43410 100644
--- a/core/modules/field/src/Tests/EntityReference/EntityReferenceFileUploadTest.php
+++ b/core/modules/field/src/Tests/EntityReference/EntityReferenceFileUploadTest.php
@@ -9,6 +9,7 @@
 
 use Drupal\Core\Field\FieldStorageDefinitionInterface;
 use Drupal\simpletest\WebTestBase;
+use Drupal\field\Entity\FieldConfig;
 
 /**
  * Tests an autocomplete widget with file upload.
@@ -63,7 +64,7 @@ protected function setUp() {
       'cardinality' => FieldStorageDefinitionInterface::CARDINALITY_UNLIMITED,
     ))->save();
 
-    entity_create('field_config', array(
+    FieldConfig::create(array(
       'label' => 'Entity reference field',
       'field_name' => 'test_field',
       'entity_type' => 'node',
@@ -89,7 +90,7 @@ protected function setUp() {
       'type' => 'file'
     ));
     $field_storage->save();
-    entity_create('field_config', array(
+    FieldConfig::create(array(
       'entity_type' => 'node',
       'field_storage' => $field_storage,
       'bundle' => $referencing->id(),
diff --git a/core/modules/field/src/Tests/EntityReference/EntityReferenceFormatterTest.php b/core/modules/field/src/Tests/EntityReference/EntityReferenceFormatterTest.php
index cc41f7d..72225ab 100644
--- a/core/modules/field/src/Tests/EntityReference/EntityReferenceFormatterTest.php
+++ b/core/modules/field/src/Tests/EntityReference/EntityReferenceFormatterTest.php
@@ -15,6 +15,7 @@
 use Drupal\system\Tests\Entity\EntityUnitTestBase;
 use Drupal\user\Entity\Role;
 use Drupal\user\RoleInterface;
+use Drupal\field\Entity\FieldConfig;
 
 /**
  * Tests the formatters functionality.
@@ -88,7 +89,7 @@ protected function setUp() {
       'type' => 'text',
       'settings' => array(),
     ))->save();
-    entity_create('field_config', array(
+    FieldConfig::create(array(
       'entity_type' => $this->entityType,
       'bundle' => $this->bundle,
       'field_name' => 'body',
diff --git a/core/modules/field/src/Tests/EntityReference/Views/SelectionTest.php b/core/modules/field/src/Tests/EntityReference/Views/SelectionTest.php
index f560876..83cbe5c 100644
--- a/core/modules/field/src/Tests/EntityReference/Views/SelectionTest.php
+++ b/core/modules/field/src/Tests/EntityReference/Views/SelectionTest.php
@@ -9,6 +9,7 @@
 
 use Drupal\simpletest\WebTestBase;
 use Drupal\views\Views;
+use Drupal\field\Entity\FieldConfig;
 
 /**
  * Tests entity reference selection handler.
@@ -61,7 +62,7 @@ public function setUp() {
       'cardinality' => '1',
     ));
     $field_storage->save();
-    $field = entity_create('field_config', array(
+    $field = FieldConfig::create(array(
       'field_storage' => $field_storage,
       'bundle' => 'test_bundle',
       'settings' => array(
diff --git a/core/modules/field/src/Tests/FieldAccessTest.php b/core/modules/field/src/Tests/FieldAccessTest.php
index 3617364..79897cf 100644
--- a/core/modules/field/src/Tests/FieldAccessTest.php
+++ b/core/modules/field/src/Tests/FieldAccessTest.php
@@ -7,6 +7,8 @@
 
 namespace Drupal\field\Tests;
 
+use Drupal\field\Entity\FieldConfig;
+
 /**
  * Tests Field access.
  *
@@ -56,7 +58,7 @@ protected function setUp() {
       'entity_type' => 'node',
       'bundle' => $content_type,
     );
-    entity_create('field_config', $field)->save();
+    FieldConfig::create($field)->save();
 
     // Assign display properties for the 'default' and 'teaser' view modes.
     foreach (array('default', 'teaser') as $view_mode) {
diff --git a/core/modules/field/src/Tests/FieldAttachStorageTest.php b/core/modules/field/src/Tests/FieldAttachStorageTest.php
index a7c7217..892cb9f 100644
--- a/core/modules/field/src/Tests/FieldAttachStorageTest.php
+++ b/core/modules/field/src/Tests/FieldAttachStorageTest.php
@@ -103,7 +103,7 @@ function testFieldAttachLoadMultiple() {
       $field_storage->save();
       $field_ids[$i] = $field_storage->uuid();
       foreach ($field_bundles_map[$i] as $bundle) {
-        entity_create('field_config', array(
+        FieldConfig::create(array(
           'field_name' => $field_names[$i],
           'entity_type' => $entity_type,
           'bundle' => $bundles[$bundle],
@@ -288,7 +288,7 @@ function testEntityCreateBundle() {
 
     // Add a field to that bundle.
     $this->fieldTestData->field_definition['bundle'] = $new_bundle;
-    entity_create('field_config', $this->fieldTestData->field_definition)->save();
+    FieldConfig::create($this->fieldTestData->field_definition)->save();
 
     // Save an entity with data in the field.
     $entity = entity_create($entity_type, array('type' => $this->fieldTestData->field->getTargetBundle()));
@@ -313,7 +313,7 @@ function testEntityDeleteBundle() {
 
     // Add a field to that bundle.
     $this->fieldTestData->field_definition['bundle'] = $new_bundle;
-    entity_create('field_config', $this->fieldTestData->field_definition)->save();
+    FieldConfig::create($this->fieldTestData->field_definition)->save();
 
     // Create a second field for the test bundle
     $field_name = Unicode::strtolower($this->randomMachineName() . '_field_name');
@@ -332,7 +332,7 @@ function testEntityDeleteBundle() {
       'description' => $this->randomMachineName() . '_description',
       'weight' => mt_rand(0, 127),
     );
-    entity_create('field_config', $field)->save();
+    FieldConfig::create($field)->save();
 
     // Save an entity with data for both fields
     $entity = entity_create($entity_type, array('type' => $this->fieldTestData->field->getTargetBundle()));
diff --git a/core/modules/field/src/Tests/FieldCrudTest.php b/core/modules/field/src/Tests/FieldCrudTest.php
index d6e9994..8ad2d21 100644
--- a/core/modules/field/src/Tests/FieldCrudTest.php
+++ b/core/modules/field/src/Tests/FieldCrudTest.php
@@ -73,7 +73,7 @@ function testCreateField() {
     // constraint for this field.
     \Drupal::state()->set('field_test_add_constraint', $this->fieldStorage->getName());
     /** @var \Drupal\Core\Field\FieldConfigInterface $field */
-    $field = entity_create('field_config', $this->fieldDefinition);
+    $field = FieldConfig::create($this->fieldDefinition);
     $field->save();
 
     $field = FieldConfig::load($field->id());
@@ -118,7 +118,7 @@ function testCreateField() {
 
     // Guarantee that the field/bundle combination is unique.
     try {
-      entity_create('field_config', $this->fieldDefinition)->save();
+      FieldConfig::create($this->fieldDefinition)->save();
       $this->fail(t('Cannot create two fields with the same field / bundle combination.'));
     }
     catch (EntityStorageException $e) {
@@ -128,7 +128,7 @@ function testCreateField() {
     // Check that the specified field exists.
     try {
       $this->fieldDefinition['field_name'] = $this->randomMachineName();
-      entity_create('field_config', $this->fieldDefinition)->save();
+      FieldConfig::create($this->fieldDefinition)->save();
       $this->fail(t('Cannot create a field with a non-existing storage.'));
     }
     catch (FieldException $e) {
@@ -180,7 +180,7 @@ public function testCreateFieldCustomStorage() {
    * Test reading back a field definition.
    */
   function testReadField() {
-    entity_create('field_config', $this->fieldDefinition)->save();
+    FieldConfig::create($this->fieldDefinition)->save();
 
     // Read the field back.
     $field = FieldConfig::load('entity_test.' . $this->fieldDefinition['bundle'] . '.' . $this->fieldDefinition['field_name']);
@@ -193,7 +193,7 @@ function testReadField() {
    * Test the update of a field.
    */
   function testUpdateField() {
-    entity_create('field_config', $this->fieldDefinition)->save();
+    FieldConfig::create($this->fieldDefinition)->save();
 
     // Check that basic changes are saved.
     $field = FieldConfig::load('entity_test.' . $this->fieldDefinition['bundle'] . '.' . $this->fieldDefinition['field_name']);
@@ -221,11 +221,11 @@ function testDeleteField() {
 
     // Create two fields for the same field storage so we can test that only one
     // is deleted.
-    entity_create('field_config', $this->fieldDefinition)->save();
+    FieldConfig::create($this->fieldDefinition)->save();
     $another_field_definition = $this->fieldDefinition;
     $another_field_definition['bundle'] .= '_another_bundle';
     entity_test_create_bundle($another_field_definition['bundle']);
-    entity_create('field_config', $another_field_definition)->save();
+    FieldConfig::create($another_field_definition)->save();
 
     // Test that the first field is not deleted, and then delete it.
     $field = current(entity_load_multiple_by_properties('field_config', array('entity_type' => 'entity_test', 'field_name' => $this->fieldDefinition['field_name'], 'bundle' => $this->fieldDefinition['bundle'], 'include_deleted' => TRUE)));
@@ -255,8 +255,8 @@ function testDeleteFieldCrossDeletion() {
 
     // Check that deletion of a field storage deletes its fields.
     $field_storage = $this->fieldStorage;
-    entity_create('field_config', $this->fieldDefinition)->save();
-    entity_create('field_config', $field_definition_2)->save();
+    FieldConfig::create($this->fieldDefinition)->save();
+    FieldConfig::create($field_definition_2)->save();
     $field_storage->delete();
     $this->assertFalse(FieldConfig::loadByName('entity_test', $this->fieldDefinition['bundle'], $field_storage->getName()));
     $this->assertFalse(FieldConfig::loadByName('entity_test', $field_definition_2['bundle'], $field_storage->getName()));
@@ -264,9 +264,9 @@ function testDeleteFieldCrossDeletion() {
     // Check that deletion of the last field deletes the storage.
     $field_storage = entity_create('field_storage_config', $this->fieldStorageDefinition);
     $field_storage->save();
-    $field = entity_create('field_config', $this->fieldDefinition);
+    $field = FieldConfig::create($this->fieldDefinition);
     $field->save();
-    $field_2 = entity_create('field_config', $field_definition_2);
+    $field_2 = FieldConfig::create($field_definition_2);
     $field_2->save();
     $field->delete();
     $this->assertTrue(FieldStorageConfig::loadByName('entity_test', $field_storage->getName()));
@@ -277,9 +277,9 @@ function testDeleteFieldCrossDeletion() {
     // the storage.
     $field_storage = entity_create('field_storage_config', $this->fieldStorageDefinition);
     $field_storage->save();
-    $field = entity_create('field_config', $this->fieldDefinition);
+    $field = FieldConfig::create($this->fieldDefinition);
     $field->save();
-    $field_2 = entity_create('field_config', $field_definition_2);
+    $field_2 = FieldConfig::create($field_definition_2);
     $field_2->save();
     $this->container->get('entity.manager')->getStorage('field_config')->delete(array($field, $field_2));
     $this->assertFalse(FieldStorageConfig::loadByName('entity_test', $field_storage->getName()));
diff --git a/core/modules/field/src/Tests/FieldDataCountTest.php b/core/modules/field/src/Tests/FieldDataCountTest.php
index bbb0cd9..6323197 100644
--- a/core/modules/field/src/Tests/FieldDataCountTest.php
+++ b/core/modules/field/src/Tests/FieldDataCountTest.php
@@ -61,7 +61,7 @@ public function testEntityCountAndHasData() {
       'cardinality' => 2,
     ));
     $field_storage->save();
-    entity_create('field_config', array(
+    FieldConfig::create(array(
       'field_storage' => $field_storage,
       'bundle' => 'entity_test',
     ))->save();
diff --git a/core/modules/field/src/Tests/FieldImportDeleteUninstallTest.php b/core/modules/field/src/Tests/FieldImportDeleteUninstallTest.php
index b5b2d157..afab668 100644
--- a/core/modules/field/src/Tests/FieldImportDeleteUninstallTest.php
+++ b/core/modules/field/src/Tests/FieldImportDeleteUninstallTest.php
@@ -7,6 +7,8 @@
 
 namespace Drupal\field\Tests;
 
+use Drupal\field\Entity\FieldConfig;
+
 /**
  * Delete field storages and fields during config synchronization and uninstall
  * module that provides the field type.
@@ -45,7 +47,7 @@ public function testImportDeleteUninstall() {
       'type' => 'integer',
     ));
     $unrelated_field_storage->save();
-    entity_create('field_config', array(
+    FieldConfig::create(array(
       'field_storage' => $unrelated_field_storage,
       'bundle' => 'entity_test',
     ))->save();
@@ -57,7 +59,7 @@ public function testImportDeleteUninstall() {
       'type' => 'telephone',
     ));
     $field_storage->save();
-    entity_create('field_config', array(
+    FieldConfig::create(array(
       'field_storage' => $field_storage,
       'bundle' => 'entity_test',
     ))->save();
@@ -120,7 +122,7 @@ public function testImportAlreadyDeletedUninstall() {
     ));
     $field_storage->save();
     $field_storage_uuid = $field_storage->uuid();
-    entity_create('field_config', array(
+    FieldConfig::create(array(
       'field_storage' => $field_storage,
       'bundle' => 'entity_test',
     ))->save();
diff --git a/core/modules/field/src/Tests/FieldImportDeleteUninstallUiTest.php b/core/modules/field/src/Tests/FieldImportDeleteUninstallUiTest.php
index 58766e8..b18bb5a 100644
--- a/core/modules/field/src/Tests/FieldImportDeleteUninstallUiTest.php
+++ b/core/modules/field/src/Tests/FieldImportDeleteUninstallUiTest.php
@@ -7,6 +7,8 @@
 
 namespace Drupal\field\Tests;
 
+use Drupal\field\Entity\FieldConfig;
+
 /**
  * Delete field storages and fields during config synchronization and uninstall
  * module that provides the field type through the UI.
@@ -42,7 +44,7 @@ public function testImportDeleteUninstall() {
       'type' => 'telephone',
     ));
     $field_storage->save();
-    entity_create('field_config', array(
+    FieldConfig::create(array(
       'field_storage' => $field_storage,
       'bundle' => 'entity_test',
     ))->save();
@@ -54,7 +56,7 @@ public function testImportDeleteUninstall() {
       'type' => 'datetime',
     ));
     $date_field_storage->save();
-    entity_create('field_config', array(
+    FieldConfig::create(array(
       'field_storage' => $date_field_storage,
       'bundle' => 'entity_test',
     ))->save();
diff --git a/core/modules/field/src/Tests/FieldStorageCrudTest.php b/core/modules/field/src/Tests/FieldStorageCrudTest.php
index 8912783..28dcbd6 100644
--- a/core/modules/field/src/Tests/FieldStorageCrudTest.php
+++ b/core/modules/field/src/Tests/FieldStorageCrudTest.php
@@ -232,7 +232,7 @@ function testRead() {
       'entity_type' => 'entity_test',
       'bundle' => 'entity_test',
     );
-    entity_create('field_config', $field_definition)->save();
+    FieldConfig::create($field_definition)->save();
   }
 
   /**
@@ -311,10 +311,10 @@ function testDelete() {
       'entity_type' => 'entity_test',
       'bundle' => 'entity_test',
     );
-    entity_create('field_config', $field_definition)->save();
+    FieldConfig::create($field_definition)->save();
     $another_field_definition = $field_definition;
     $another_field_definition['field_name'] = $another_field_storage_definition['field_name'];
-    entity_create('field_config', $another_field_definition)->save();
+    FieldConfig::create($another_field_definition)->save();
 
     // Test that the first field is not deleted, and then delete it.
     $field_storage = current(entity_load_multiple_by_properties('field_storage_config', array('field_name' => $field_storage_definition['field_name'], 'include_deleted' => TRUE)));
@@ -348,7 +348,7 @@ function testDelete() {
     // Try to create a new field the same name as a deleted field and
     // write data into it.
     entity_create('field_storage_config', $field_storage_definition)->save();
-    entity_create('field_config', $field_definition)->save();
+    FieldConfig::create($field_definition)->save();
     $field_storage = FieldStorageConfig::load('entity_test.' . $field_storage_definition['field_name']);
     $this->assertTrue(!empty($field_storage) && !$field_storage->isDeleted(), 'A new storage with a previously used name is created.');
     $field = FieldConfig::load('entity_test.' . $field_definition['bundle'] . '.' . $field_definition['field_name'] );
@@ -400,7 +400,7 @@ function testUpdate() {
       'cardinality' => $cardinality,
     ));
     $field_storage->save();
-    $field = entity_create('field_config', array(
+    $field = FieldConfig::create(array(
       'field_storage' => $field_storage,
       'entity_type' => 'entity_test',
       'bundle' => 'entity_test',
diff --git a/core/modules/field/src/Tests/FieldUnitTestBase.php b/core/modules/field/src/Tests/FieldUnitTestBase.php
index ddcf3f9..4382052 100644
--- a/core/modules/field/src/Tests/FieldUnitTestBase.php
+++ b/core/modules/field/src/Tests/FieldUnitTestBase.php
@@ -11,6 +11,7 @@
 use Drupal\Core\Entity\EntityInterface;
 use Drupal\Core\Language\LanguageInterface;
 use Drupal\simpletest\KernelTestBase;
+use Drupal\field\Entity\FieldConfig;
 
 /**
  * Parent class for Field API unit tests.
@@ -108,7 +109,7 @@ protected function createFieldWithStorage($suffix = '', $entity_type = 'entity_t
         'test_field_setting' => $this->randomMachineName(),
       ),
     );
-    $this->fieldTestData->$field = entity_create('field_config', $this->fieldTestData->$field_definition);
+    $this->fieldTestData->$field = FieldConfig::create($this->fieldTestData->$field_definition);
     $this->fieldTestData->$field->save();
 
     entity_get_form_display($entity_type, $bundle, 'default')
diff --git a/core/modules/field/src/Tests/FormTest.php b/core/modules/field/src/Tests/FormTest.php
index dbdc71a..daf7f3a 100644
--- a/core/modules/field/src/Tests/FormTest.php
+++ b/core/modules/field/src/Tests/FormTest.php
@@ -100,7 +100,7 @@ function testFieldFormSingle() {
     $field_name = $field_storage['field_name'];
     $this->field['field_name'] = $field_name;
     entity_create('field_storage_config', $field_storage)->save();
-    entity_create('field_config', $this->field)->save();
+    FieldConfig::create($this->field)->save();
     entity_get_form_display($this->field['entity_type'], $this->field['bundle'], 'default')
       ->setComponent($field_name)
       ->save();
@@ -176,7 +176,7 @@ function testFieldFormDefaultValue() {
     $default = rand(1, 127);
     $this->field['default_value'] = array(array('value' => $default));
     entity_create('field_storage_config', $field_storage)->save();
-    entity_create('field_config', $this->field)->save();
+    FieldConfig::create($this->field)->save();
     entity_get_form_display($this->field['entity_type'], $this->field['bundle'], 'default')
       ->setComponent($field_name)
       ->save();
@@ -204,7 +204,7 @@ function testFieldFormSingleRequired() {
     $this->field['field_name'] = $field_name;
     $this->field['required'] = TRUE;
     entity_create('field_storage_config', $field_storage)->save();
-    entity_create('field_config', $this->field)->save();
+    FieldConfig::create($this->field)->save();
     entity_get_form_display($this->field['entity_type'], $this->field['bundle'], 'default')
       ->setComponent($field_name)
       ->save();
@@ -240,7 +240,7 @@ function testFieldFormSingleRequired() {
 //    $field_name = $this->field['field_name'];
 //    $this->instance['field_name'] = $field_name;
 //    entity_create('field_storage_config', $this->field)->save();
-//    entity_create('field_config', $this->instance)->save();
+//    FieldConfig::create($this->instance)->save();
 //  }
 
   function testFieldFormUnlimited() {
@@ -248,7 +248,7 @@ function testFieldFormUnlimited() {
     $field_name = $field_storage['field_name'];
     $this->field['field_name'] = $field_name;
     entity_create('field_storage_config', $field_storage)->save();
-    entity_create('field_config', $this->field)->save();
+    FieldConfig::create($this->field)->save();
     entity_get_form_display($this->field['entity_type'], $this->field['bundle'], 'default')
       ->setComponent($field_name)
       ->save();
@@ -359,7 +359,7 @@ function testFieldFormMultivalueWithRequiredRadio() {
     $field_name = $field_storage['field_name'];
     $this->field['field_name'] = $field_name;
     entity_create('field_storage_config', $field_storage)->save();
-    entity_create('field_config', $this->field)->save();
+    FieldConfig::create($this->field)->save();
     entity_get_form_display($this->field['entity_type'], $this->field['bundle'], 'default')
       ->setComponent($field_name)
       ->save();
@@ -379,7 +379,7 @@ function testFieldFormMultivalueWithRequiredRadio() {
       'bundle' => 'entity_test',
       'required' => TRUE,
     );
-    entity_create('field_config', $field)->save();
+    FieldConfig::create($field)->save();
     entity_get_form_display($field['entity_type'], $field['bundle'], 'default')
       ->setComponent($field['field_name'], array(
         'type' => 'options_buttons',
@@ -406,7 +406,7 @@ function testFieldFormJSAddMore() {
     $field_name = $field_storage['field_name'];
     $this->field['field_name'] = $field_name;
     entity_create('field_storage_config', $field_storage)->save();
-    entity_create('field_config', $this->field)->save();
+    FieldConfig::create($this->field)->save();
     entity_get_form_display($this->field['entity_type'], $this->field['bundle'], 'default')
       ->setComponent($field_name)
       ->save();
@@ -467,7 +467,7 @@ function testFieldFormMultipleWidget() {
     $field_name = $field_storage['field_name'];
     $this->field['field_name'] = $field_name;
     entity_create('field_storage_config', $field_storage)->save();
-    entity_create('field_config', $this->field)->save();
+    FieldConfig::create($this->field)->save();
     entity_get_form_display($this->field['entity_type'], $this->field['bundle'], 'default')
       ->setComponent($field_name, array(
         'type' => 'test_field_widget_multiple',
@@ -516,7 +516,7 @@ function testFieldFormAccess() {
     $field['entity_type'] = $entity_type;
     $field['bundle'] = $entity_type;
     entity_create('field_storage_config', $field_storage)->save();
-    entity_create('field_config', $field)->save();
+    FieldConfig::create($field)->save();
     entity_get_form_display($entity_type, $entity_type, 'default')
       ->setComponent($field_name)
       ->save();
@@ -536,7 +536,7 @@ function testFieldFormAccess() {
       'default_value' => array(0 => array('value' => 99)),
     );
     entity_create('field_storage_config', $field_storage_no_access)->save();
-    entity_create('field_config', $field_no_access)->save();
+    FieldConfig::create($field_no_access)->save();
     entity_get_form_display($field_no_access['entity_type'], $field_no_access['bundle'], 'default')
       ->setComponent($field_name_no_access)
       ->save();
@@ -601,7 +601,7 @@ function testHiddenField() {
     $this->field['entity_type'] = $entity_type;
     $this->field['bundle'] = $entity_type;
     entity_create('field_storage_config', $field_storage)->save();
-    $this->field = entity_create('field_config', $this->field);
+    $this->field = FieldConfig::create($this->field);
     $this->field->save();
     // We explicitly do not assign a widget in a form display, so the field
     // stays hidden in forms.
diff --git a/core/modules/field/src/Tests/NestedFormTest.php b/core/modules/field/src/Tests/NestedFormTest.php
index 5067b97..4c31084 100644
--- a/core/modules/field/src/Tests/NestedFormTest.php
+++ b/core/modules/field/src/Tests/NestedFormTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\field\Tests;
 use Drupal\Core\Field\FieldStorageDefinitionInterface;
+use Drupal\field\Entity\FieldConfig;
 
 /**
  * Tests field elements in nested forms.
@@ -61,13 +62,13 @@ function testNestedFieldForm() {
     entity_create('field_storage_config', $this->fieldStorageUnlimited)->save();
     $this->field['field_name'] = 'field_single';
     $this->field['label'] = 'Single field';
-    entity_create('field_config', $this->field)->save();
+    FieldConfig::create($this->field)->save();
     entity_get_form_display($this->field['entity_type'], $this->field['bundle'], 'default')
       ->setComponent($this->field['field_name'])
       ->save();
     $this->field['field_name'] = 'field_unlimited';
     $this->field['label'] = 'Unlimited field';
-    entity_create('field_config', $this->field)->save();
+    FieldConfig::create($this->field)->save();
     entity_get_form_display($this->field['entity_type'], $this->field['bundle'], 'default')
       ->setComponent($this->field['field_name'])
       ->save();
diff --git a/core/modules/field/src/Tests/Number/NumberFieldTest.php b/core/modules/field/src/Tests/Number/NumberFieldTest.php
index 9537170..6c74e68 100644
--- a/core/modules/field/src/Tests/Number/NumberFieldTest.php
+++ b/core/modules/field/src/Tests/Number/NumberFieldTest.php
@@ -9,6 +9,7 @@
 
 use Drupal\Component\Utility\Unicode;
 use Drupal\simpletest\WebTestBase;
+use Drupal\field\Entity\FieldConfig;
 
 /**
  * Tests the creation of numeric fields.
@@ -51,7 +52,7 @@ function testNumberDecimalField() {
         'precision' => 8, 'scale' => 4,
       )
     ))->save();
-    entity_create('field_config', array(
+    FieldConfig::create(array(
       'field_name' => $field_name,
       'entity_type' => 'entity_test',
       'bundle' => 'entity_test',
@@ -140,7 +141,7 @@ function testNumberIntegerField() {
     ));
     $storage->save();
 
-    entity_create('field_config', array(
+    FieldConfig::create(array(
       'field_name' => $field_name,
       'entity_type' => 'entity_test',
       'bundle' => 'entity_test',
@@ -282,7 +283,7 @@ function testNumberFloatField() {
       'type' => 'float',
     ))->save();
 
-    entity_create('field_config', array(
+    FieldConfig::create(array(
       'field_name' => $field_name,
       'entity_type' => 'entity_test',
       'bundle' => 'entity_test',
@@ -389,7 +390,7 @@ function testNumberFormatter() {
       'type' => 'integer',
     ))->save();
 
-    entity_create('field_config', array(
+    FieldConfig::create(array(
       'field_name' => $float_field,
       'entity_type' => 'node',
       'bundle' => $type,
@@ -399,7 +400,7 @@ function testNumberFormatter() {
       ),
     ))->save();
 
-    entity_create('field_config', array(
+    FieldConfig::create(array(
       'field_name' => $integer_field,
       'entity_type' => 'node',
       'bundle' => $type,
@@ -507,7 +508,7 @@ function testCreateNumberFloatField() {
       'type' => 'float',
     ))->save();
 
-    $field = entity_create('field_config', array(
+    $field = FieldConfig::create(array(
       'field_name' => $field_name,
       'entity_type' => 'entity_test',
       'bundle' => 'entity_test',
@@ -532,7 +533,7 @@ function testCreateNumberDecimalField() {
       'type' => 'decimal',
     ))->save();
 
-    $field = entity_create('field_config', array(
+    $field = FieldConfig::create(array(
       'field_name' => $field_name,
       'entity_type' => 'entity_test',
       'bundle' => 'entity_test',
diff --git a/core/modules/field/src/Tests/Number/NumberItemTest.php b/core/modules/field/src/Tests/Number/NumberItemTest.php
index e7eac30..25921fc 100644
--- a/core/modules/field/src/Tests/Number/NumberItemTest.php
+++ b/core/modules/field/src/Tests/Number/NumberItemTest.php
@@ -10,6 +10,7 @@
 use Drupal\Core\Field\FieldItemInterface;
 use Drupal\Core\Field\FieldItemListInterface;
 use Drupal\field\Tests\FieldUnitTestBase;
+use Drupal\field\Entity\FieldConfig;
 
 /**
  * Tests the new entity API for the number field type.
@@ -35,7 +36,7 @@ protected function setUp() {
         'field_name' => 'field_' . $type,
         'type' => $type,
       ))->save();
-      entity_create('field_config', array(
+      FieldConfig::create(array(
         'entity_type' => 'entity_test',
         'field_name' => 'field_' . $type,
         'bundle' => 'entity_test',
diff --git a/core/modules/field/src/Tests/ShapeItemTest.php b/core/modules/field/src/Tests/ShapeItemTest.php
index 9f7df3b..b37ad03 100644
--- a/core/modules/field/src/Tests/ShapeItemTest.php
+++ b/core/modules/field/src/Tests/ShapeItemTest.php
@@ -9,6 +9,7 @@
 
 use Drupal\Core\Field\FieldItemInterface;
 use Drupal\Core\Field\FieldItemListInterface;
+use Drupal\field\Entity\FieldConfig;
 
 /**
  * Tests the new entity API for the shape field type.
@@ -40,7 +41,7 @@ protected function setUp() {
       'entity_type' => 'entity_test',
       'type' => 'shape',
     ))->save();
-    entity_create('field_config', array(
+    FieldConfig::create(array(
       'entity_type' => 'entity_test',
       'field_name' => $this->fieldName,
       'bundle' => 'entity_test',
diff --git a/core/modules/field/src/Tests/String/StringFieldTest.php b/core/modules/field/src/Tests/String/StringFieldTest.php
index 3114490..502b9d1 100644
--- a/core/modules/field/src/Tests/String/StringFieldTest.php
+++ b/core/modules/field/src/Tests/String/StringFieldTest.php
@@ -9,6 +9,7 @@
 
 use Drupal\Component\Utility\Unicode;
 use Drupal\simpletest\WebTestBase;
+use Drupal\field\Entity\FieldConfig;
 
 /**
  * Tests the creation of string fields.
@@ -60,7 +61,7 @@ function _testTextfieldWidgets($field_type, $widget_type) {
       'type' => $field_type
     ));
     $field_storage->save();
-    entity_create('field_config', array(
+    FieldConfig::create(array(
       'field_storage' => $field_storage,
       'bundle' => 'entity_test',
       'label' => $this->randomMachineName() . '_label',
diff --git a/core/modules/field/src/Tests/TestItemTest.php b/core/modules/field/src/Tests/TestItemTest.php
index 7aa4679..31813a6 100644
--- a/core/modules/field/src/Tests/TestItemTest.php
+++ b/core/modules/field/src/Tests/TestItemTest.php
@@ -10,6 +10,7 @@
 use Drupal\Core\Field\BaseFieldDefinition;
 use Drupal\Core\Field\FieldItemInterface;
 use Drupal\Core\Field\FieldItemListInterface;
+use Drupal\field\Entity\FieldConfig;
 
 /**
  * Tests the new entity API for the test field type.
@@ -41,7 +42,7 @@ protected function setUp() {
       'entity_type' => 'entity_test',
       'type' => 'test_field',
     ))->save();
-    entity_create('field_config', array(
+    FieldConfig::create(array(
       'entity_type' => 'entity_test',
       'field_name' => $this->fieldName,
       'bundle' => 'entity_test',
diff --git a/core/modules/field/src/Tests/TestItemWithDependenciesTest.php b/core/modules/field/src/Tests/TestItemWithDependenciesTest.php
index a3be92b..a93f9c9 100644
--- a/core/modules/field/src/Tests/TestItemWithDependenciesTest.php
+++ b/core/modules/field/src/Tests/TestItemWithDependenciesTest.php
@@ -7,6 +7,8 @@
 
 namespace Drupal\field\Tests;
 
+use Drupal\field\Entity\FieldConfig;
+
 /**
  * Tests the new entity API for the test field with dependencies type.
  *
@@ -38,7 +40,7 @@ public function testTestItemWithDepenencies() {
       'entity_type' => 'entity_test',
       'type' => 'test_field_with_dependencies',
     ))->save();
-    $field = entity_create('field_config', array(
+    $field = FieldConfig::create(array(
       'entity_type' => 'entity_test',
       'field_name' => $this->fieldName,
       'bundle' => 'entity_test',
diff --git a/core/modules/field/src/Tests/TranslationTest.php b/core/modules/field/src/Tests/TranslationTest.php
index 8328951..eb5df50 100644
--- a/core/modules/field/src/Tests/TranslationTest.php
+++ b/core/modules/field/src/Tests/TranslationTest.php
@@ -9,6 +9,7 @@
 
 use Drupal\Component\Utility\Unicode;
 use Drupal\language\Entity\ConfigurableLanguage;
+use Drupal\field\Entity\FieldConfig;
 
 /**
  * Tests multilanguage fields logic.
@@ -95,7 +96,7 @@ protected function setUp() {
       'field_storage' => $this->fieldStorage,
       'bundle' => 'entity_test',
     );
-    $this->field = entity_create('field_config', $this->fieldDefinition);
+    $this->field = FieldConfig::create($this->fieldDefinition);
     $this->field->save();
 
     for ($i = 0; $i < 3; ++$i) {
@@ -150,7 +151,7 @@ function testTranslatableFieldSaveLoad() {
     $field_definition = $this->fieldDefinition;
     $field_definition['field_storage'] = $field_storage;
     $field_definition['default_value'] = array(array('value' => rand(1, 127)));
-    $field = entity_create('field_config', $field_definition);
+    $field = FieldConfig::create($field_definition);
     $field->save();
 
     $translation_langcodes = array_slice($available_langcodes, 0, 2);
diff --git a/core/modules/field/src/Tests/TranslationWebTest.php b/core/modules/field/src/Tests/TranslationWebTest.php
index 8350285..76cc516 100644
--- a/core/modules/field/src/Tests/TranslationWebTest.php
+++ b/core/modules/field/src/Tests/TranslationWebTest.php
@@ -72,7 +72,7 @@ protected function setUp() {
       'field_storage' => $this->fieldStorage,
       'bundle' => $this->entityTypeId,
     );
-    entity_create('field_config', $field)->save();
+    FieldConfig::create($field)->save();
     $this->field = FieldConfig::load($this->entityTypeId . '.' . $field['bundle'] . '.' . $this->fieldName);
 
     entity_get_form_display($this->entityTypeId, $this->entityTypeId, 'default')
diff --git a/core/modules/field/src/Tests/Views/FieldTestBase.php b/core/modules/field/src/Tests/Views/FieldTestBase.php
index 0425c29..b7920eb 100644
--- a/core/modules/field/src/Tests/Views/FieldTestBase.php
+++ b/core/modules/field/src/Tests/Views/FieldTestBase.php
@@ -21,6 +21,7 @@
 
 use Drupal\views\Tests\ViewTestBase;
 use Drupal\views\Tests\ViewTestData;
+use Drupal\field\Entity\FieldConfig;
 
 /**
  * Provides some helper methods for testing fieldapi integration into views.
@@ -78,7 +79,7 @@ function setUpFieldStorages($amount = 3, $type = 'string') {
 
   function setUpFields($bundle = 'page') {
     foreach ($this->fieldStorages as $key => $field_storage) {
-      $this->fields[$key] = entity_create('field_config', array(
+      $this->fields[$key] = FieldConfig::create(array(
         'field_storage' => $field_storage,
         'bundle' => $bundle,
       ));
diff --git a/core/modules/field/src/Tests/reEnableModuleFieldTest.php b/core/modules/field/src/Tests/reEnableModuleFieldTest.php
index 3a72c67..d4e0fae 100644
--- a/core/modules/field/src/Tests/reEnableModuleFieldTest.php
+++ b/core/modules/field/src/Tests/reEnableModuleFieldTest.php
@@ -8,6 +8,7 @@
 namespace Drupal\field\Tests;
 
 use Drupal\simpletest\WebTestBase;
+use Drupal\field\Entity\FieldConfig;
 
 /**
  * Tests the behavior of a field module after being disabled and re-enabled.
@@ -53,7 +54,7 @@ function testReEnabledField() {
       'type' => 'telephone',
     ));
     $field_storage->save();
-    entity_create('field_config', array(
+    FieldConfig::create(array(
       'field_storage' => $field_storage,
       'bundle' => 'article',
       'label' => 'Telephone Number',
diff --git a/core/modules/file/src/Tests/FileFieldTestBase.php b/core/modules/file/src/Tests/FileFieldTestBase.php
index 5874cf5..eee4250 100644
--- a/core/modules/file/src/Tests/FileFieldTestBase.php
+++ b/core/modules/file/src/Tests/FileFieldTestBase.php
@@ -113,7 +113,7 @@ function attachFileField($name, $entity_type, $bundle, $field_settings = array()
       'required' => !empty($field_settings['required']),
       'settings' => $field_settings,
     );
-    entity_create('field_config', $field)->save();
+    FieldConfig::create($field)->save();
 
     entity_get_form_display($entity_type, $bundle, 'default')
       ->setComponent($name, array(
diff --git a/core/modules/file/src/Tests/FileItemTest.php b/core/modules/file/src/Tests/FileItemTest.php
index 9337ca0..5bf4935 100644
--- a/core/modules/file/src/Tests/FileItemTest.php
+++ b/core/modules/file/src/Tests/FileItemTest.php
@@ -54,7 +54,7 @@ protected function setUp() {
       'cardinality' => FieldStorageDefinitionInterface::CARDINALITY_UNLIMITED,
     ))->save();
     $this->directory = $this->getRandomGenerator()->name(8);
-    entity_create('field_config', array(
+    FieldConfig::create(array(
       'entity_type' => 'entity_test',
       'field_name' => 'file_test',
       'bundle' => 'entity_test',
diff --git a/core/modules/file/src/Tests/Views/RelationshipUserFileDataTest.php b/core/modules/file/src/Tests/Views/RelationshipUserFileDataTest.php
index 8cdc903..9453a5f 100644
--- a/core/modules/file/src/Tests/Views/RelationshipUserFileDataTest.php
+++ b/core/modules/file/src/Tests/Views/RelationshipUserFileDataTest.php
@@ -10,6 +10,7 @@
 use Drupal\views\Tests\ViewTestBase;
 use Drupal\views\Views;
 use Drupal\views\Tests\ViewTestData;
+use Drupal\field\Entity\FieldConfig;
 
 /**
  * Tests file on user relationship handler.
@@ -42,7 +43,7 @@ protected function setUp() {
       'type' => 'file',
       'translatable' => '0',
     ))->save();
-    entity_create('field_config', array(
+    FieldConfig::create(array(
       'label' => 'User File',
       'description' => '',
       'field_name' => 'user_file',
diff --git a/core/modules/hal/src/Tests/NormalizerTestBase.php b/core/modules/hal/src/Tests/NormalizerTestBase.php
index 104a5e2..f4f4bb0 100644
--- a/core/modules/hal/src/Tests/NormalizerTestBase.php
+++ b/core/modules/hal/src/Tests/NormalizerTestBase.php
@@ -7,6 +7,8 @@
 
 namespace Drupal\hal\Tests;
 
+use Drupal\field\Entity\FieldConfig;
+
 use Drupal\Core\Cache\MemoryBackend;
 use Drupal\hal\Encoder\JsonEncoder;
 use Drupal\hal\Normalizer\ContentEntityNormalizer;
@@ -98,7 +100,7 @@ protected function setUp() {
       'entity_type' => 'entity_test',
       'type' => 'text',
     ))->save();
-    entity_create('field_config', array(
+    FieldConfig::create(array(
       'entity_type' => 'entity_test',
       'field_name' => 'field_test_text',
       'bundle' => 'entity_test',
@@ -111,7 +113,7 @@ protected function setUp() {
       'entity_type' => 'entity_test',
       'type' => 'text',
     ))->save();
-    entity_create('field_config', array(
+    FieldConfig::create(array(
       'entity_type' => 'entity_test',
       'field_name' => 'field_test_translatable_text',
       'bundle' => 'entity_test',
@@ -127,7 +129,7 @@ protected function setUp() {
         'target_type' => 'entity_test',
       ),
     ))->save();
-    entity_create('field_config', array(
+    FieldConfig::create(array(
       'entity_type' => 'entity_test',
       'field_name' => 'field_test_entity_reference',
       'bundle' => 'entity_test',
diff --git a/core/modules/image/src/Tests/ImageFieldDefaultImagesTest.php b/core/modules/image/src/Tests/ImageFieldDefaultImagesTest.php
index c33ca1e..ead025f 100644
--- a/core/modules/image/src/Tests/ImageFieldDefaultImagesTest.php
+++ b/core/modules/image/src/Tests/ImageFieldDefaultImagesTest.php
@@ -8,6 +8,7 @@
 namespace Drupal\image\Tests;
 use Drupal\Component\Utility\Unicode;
 use Drupal\file\Entity\File;
+use Drupal\field\Entity\FieldConfig;
 
 /**
  * Tests setting up default images both to the field and field field.
@@ -81,7 +82,7 @@ public function testDefaultImages() {
     $this->assertEqual($field_storage->getSettings()['default_image']['uuid'], $default_images['field']->uuid());
 
     // Add another field with another default image to the page content type.
-    $field2 = entity_create('field_config', array(
+    $field2 = FieldConfig::create(array(
       'field_storage' => $field_storage,
       'bundle' => 'page',
       'label' => $field->label(),
@@ -326,7 +327,7 @@ public function testInvalidDefaultImage() {
     // The non-existent default image should not be saved.
     $this->assertNull($settings['default_image']['uuid']);
 
-    $field = entity_create('field_config', array(
+    $field = FieldConfig::create(array(
       'field_storage' => $field_storage,
       'bundle' => 'page',
       'label' => $this->randomMachineName(),
diff --git a/core/modules/image/src/Tests/ImageFieldTestBase.php b/core/modules/image/src/Tests/ImageFieldTestBase.php
index 271b969..4704c90 100644
--- a/core/modules/image/src/Tests/ImageFieldTestBase.php
+++ b/core/modules/image/src/Tests/ImageFieldTestBase.php
@@ -8,6 +8,7 @@
 namespace Drupal\image\Tests;
 
 use Drupal\simpletest\WebTestBase;
+use Drupal\field\Entity\FieldConfig;
 
 /**
  * TODO: Test the following functions.
@@ -77,7 +78,7 @@ function createImageField($name, $type_name, $storage_settings = array(), $field
       'cardinality' => !empty($storage_settings['cardinality']) ? $storage_settings['cardinality'] : 1,
     ))->save();
 
-    $field_config = entity_create('field_config', array(
+    $field_config = FieldConfig::create(array(
       'field_name' => $name,
       'label' => $name,
       'entity_type' => 'node',
diff --git a/core/modules/image/src/Tests/ImageItemTest.php b/core/modules/image/src/Tests/ImageItemTest.php
index fddbd3f..8716263 100644
--- a/core/modules/image/src/Tests/ImageItemTest.php
+++ b/core/modules/image/src/Tests/ImageItemTest.php
@@ -11,6 +11,7 @@
 use Drupal\Core\Field\FieldItemListInterface;
 use Drupal\Core\Field\FieldStorageDefinitionInterface;
 use Drupal\field\Tests\FieldUnitTestBase;
+use Drupal\field\Entity\FieldConfig;
 
 /**
  * Tests using entity fields of the image field type.
@@ -50,7 +51,7 @@ protected function setUp() {
       'type' => 'image',
       'cardinality' => FieldStorageDefinitionInterface::CARDINALITY_UNLIMITED,
     ))->save();
-    entity_create('field_config', array(
+    FieldConfig::create(array(
       'entity_type' => 'entity_test',
       'field_name' => 'image_test',
       'bundle' => 'entity_test',
diff --git a/core/modules/image/src/Tests/ImageThemeFunctionTest.php b/core/modules/image/src/Tests/ImageThemeFunctionTest.php
index 54b471b..ffd92b4 100644
--- a/core/modules/image/src/Tests/ImageThemeFunctionTest.php
+++ b/core/modules/image/src/Tests/ImageThemeFunctionTest.php
@@ -10,6 +10,7 @@
 use Drupal\Core\Field\FieldStorageDefinitionInterface;
 use Drupal\Core\Url;
 use Drupal\simpletest\WebTestBase;
+use Drupal\field\Entity\FieldConfig;
 
 /**
  * Tests image theme functions.
@@ -46,7 +47,7 @@ protected function setUp() {
       'type' => 'image',
       'cardinality' => FieldStorageDefinitionInterface::CARDINALITY_UNLIMITED,
     ))->save();
-    entity_create('field_config', array(
+    FieldConfig::create(array(
       'entity_type' => 'entity_test',
       'field_name' => 'image_test',
       'bundle' => 'entity_test',
diff --git a/core/modules/image/src/Tests/Views/RelationshipUserImageDataTest.php b/core/modules/image/src/Tests/Views/RelationshipUserImageDataTest.php
index 4ef0626..70c59c3 100644
--- a/core/modules/image/src/Tests/Views/RelationshipUserImageDataTest.php
+++ b/core/modules/image/src/Tests/Views/RelationshipUserImageDataTest.php
@@ -10,6 +10,7 @@
 use Drupal\views\Tests\ViewTestBase;
 use Drupal\views\Views;
 use Drupal\views\Tests\ViewTestData;
+use Drupal\field\Entity\FieldConfig;
 
 /**
  * Tests image on user relationship handler.
@@ -42,7 +43,7 @@ protected function setUp() {
       'type' => 'image',
       'translatable' => '0',
     ))->save();
-    entity_create('field_config', array(
+    FieldConfig::create(array(
       'label' => 'User Picture',
       'description' => '',
       'field_name' => 'user_picture',
diff --git a/core/modules/language/src/Entity/ContentLanguageSettings.php b/core/modules/language/src/Entity/ContentLanguageSettings.php
index 7501012..d81265d 100644
--- a/core/modules/language/src/Entity/ContentLanguageSettings.php
+++ b/core/modules/language/src/Entity/ContentLanguageSettings.php
@@ -12,6 +12,7 @@
 use Drupal\Core\Language\LanguageInterface;
 use Drupal\language\ContentLanguageSettingsException;
 use Drupal\language\ContentLanguageSettingsInterface;
+use Drupal\field\Entity\FieldConfig;
 
 /**
  * Defines the ContentLanguageSettings entity.
@@ -67,7 +68,7 @@ class ContentLanguageSettings extends ConfigEntityBase implements ContentLanguag
    * Constructs a ContentLanguageSettings object.
    *
    * In most cases, Field entities are created via
-   * entity_create('field_config', $values), where $values is the same
+   * FieldConfig::create($values), where $values is the same
    * parameter as in this constructor.
    *
    * @param array $values
diff --git a/core/modules/link/src/Tests/LinkFieldTest.php b/core/modules/link/src/Tests/LinkFieldTest.php
index eada494..78ba332 100644
--- a/core/modules/link/src/Tests/LinkFieldTest.php
+++ b/core/modules/link/src/Tests/LinkFieldTest.php
@@ -12,6 +12,7 @@
 use Drupal\Core\Url;
 use Drupal\link\LinkItemInterface;
 use Drupal\simpletest\WebTestBase;
+use Drupal\field\Entity\FieldConfig;
 
 /**
  * Tests link field widgets and formatters.
@@ -63,7 +64,7 @@ function testURLValidation() {
       'type' => 'link',
     ));
     $this->fieldStorage->save();
-    $this->field = entity_create('field_config', array(
+    $this->field = FieldConfig::create(array(
       'field_storage' => $this->fieldStorage,
       'bundle' => 'entity_test',
       'settings' => array(
@@ -224,7 +225,7 @@ function testLinkTitle() {
       'type' => 'link',
     ));
     $this->fieldStorage->save();
-    $this->field = entity_create('field_config', array(
+    $this->field = FieldConfig::create(array(
       'field_storage' => $this->fieldStorage,
       'bundle' => 'entity_test',
       'label' => 'Read more about this entity',
@@ -339,7 +340,7 @@ function testLinkFormatter() {
       'cardinality' => 2,
     ));
     $this->fieldStorage->save();
-    entity_create('field_config', array(
+    FieldConfig::create(array(
       'field_storage' => $this->fieldStorage,
       'label' => 'Read more about this entity',
       'bundle' => 'entity_test',
@@ -479,7 +480,7 @@ function testLinkSeparateFormatter() {
       'cardinality' => 2,
     ));
     $this->fieldStorage->save();
-    entity_create('field_config', array(
+    FieldConfig::create(array(
       'field_storage' => $this->fieldStorage,
       'bundle' => 'entity_test',
       'settings' => array(
diff --git a/core/modules/node/node.module b/core/modules/node/node.module
index a54fc0a..0b62506 100644
--- a/core/modules/node/node.module
+++ b/core/modules/node/node.module
@@ -324,7 +324,7 @@ function node_add_body_field(NodeTypeInterface $type, $label = 'Body') {
   $field_storage = FieldStorageConfig::loadByName('node', 'body');
   $field = FieldConfig::loadByName('node', $type->id(), 'body');
   if (empty($field)) {
-    $field = entity_create('field_config', array(
+    $field = FieldConfig::create(array(
       'field_storage' => $field_storage,
       'bundle' => $type->id(),
       'label' => $label,
diff --git a/core/modules/node/src/Tests/MultiStepNodeFormBasicOptionsTest.php b/core/modules/node/src/Tests/MultiStepNodeFormBasicOptionsTest.php
index 84ffbe2..334bb5d 100644
--- a/core/modules/node/src/Tests/MultiStepNodeFormBasicOptionsTest.php
+++ b/core/modules/node/src/Tests/MultiStepNodeFormBasicOptionsTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\node\Tests;
 use Drupal\Component\Utility\Unicode;
+use Drupal\field\Entity\FieldConfig;
 
 /**
  * Tests the persistence of basic options through multiple steps.
@@ -40,7 +41,7 @@ function testMultiStepNodeFormBasicOptions() {
     ))->save();
 
     // Attach an instance of the field to the page content type.
-    entity_create('field_config', array(
+    FieldConfig::create(array(
       'field_name' => $this->fieldName,
       'entity_type' => 'node',
       'bundle' => 'page',
diff --git a/core/modules/node/src/Tests/NodeAccessFieldTest.php b/core/modules/node/src/Tests/NodeAccessFieldTest.php
index ab490bb..9680da7 100644
--- a/core/modules/node/src/Tests/NodeAccessFieldTest.php
+++ b/core/modules/node/src/Tests/NodeAccessFieldTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\node\Tests;
 use Drupal\Component\Utility\Unicode;
+use Drupal\field\Entity\FieldConfig;
 
 /**
  * Tests the interaction of the node access system with fields.
@@ -59,7 +60,7 @@ protected function setUp() {
       'entity_type' => 'node',
       'type' => 'text'
     ))->save();
-    entity_create('field_config', array(
+    FieldConfig::create(array(
       'field_name' => $this->fieldName,
       'entity_type' => 'node',
       'bundle' => 'page',
diff --git a/core/modules/node/src/Tests/NodeAccessLanguageAwareCombinationTest.php b/core/modules/node/src/Tests/NodeAccessLanguageAwareCombinationTest.php
index 3051af1..ec9f0fc 100644
--- a/core/modules/node/src/Tests/NodeAccessLanguageAwareCombinationTest.php
+++ b/core/modules/node/src/Tests/NodeAccessLanguageAwareCombinationTest.php
@@ -11,6 +11,7 @@
 use Drupal\language\Entity\ConfigurableLanguage;
 use Drupal\node\Entity\NodeType;
 use Drupal\user\Entity\User;
+use Drupal\field\Entity\FieldConfig;
 
 /**
  * Tests node access functionality with multiple languages and two node access
@@ -63,7 +64,7 @@ protected function setUp() {
     ));
     $field_storage->save();
 
-    entity_create('field_config', array(
+    FieldConfig::create(array(
       'field_storage' => $field_storage,
       'bundle' => 'page',
       'widget' => array(
diff --git a/core/modules/node/src/Tests/NodeAccessLanguageAwareTest.php b/core/modules/node/src/Tests/NodeAccessLanguageAwareTest.php
index 5770746..0b84477 100644
--- a/core/modules/node/src/Tests/NodeAccessLanguageAwareTest.php
+++ b/core/modules/node/src/Tests/NodeAccessLanguageAwareTest.php
@@ -10,6 +10,7 @@
 use Drupal\Core\Language\LanguageInterface;
 use Drupal\language\Entity\ConfigurableLanguage;
 use Drupal\user\Entity\User;
+use Drupal\field\Entity\FieldConfig;
 
 /**
  * Tests node_access and db_select() with node_access tag functionality with
@@ -60,7 +61,7 @@ protected function setUp() {
     ));
     $field_storage->save();
 
-    entity_create('field_config', array(
+    FieldConfig::create(array(
       'field_storage' => $field_storage,
       'bundle' => 'page',
       'widget' => array(
diff --git a/core/modules/options/src/Tests/OptionsDynamicValuesTestBase.php b/core/modules/options/src/Tests/OptionsDynamicValuesTestBase.php
index 0bc99f0..d268efd 100644
--- a/core/modules/options/src/Tests/OptionsDynamicValuesTestBase.php
+++ b/core/modules/options/src/Tests/OptionsDynamicValuesTestBase.php
@@ -8,6 +8,7 @@
 namespace Drupal\options\Tests;
 
 use Drupal\field\Tests\FieldTestBase;
+use Drupal\field\Entity\FieldConfig;
 
 /**
  * Base class for testing allowed values of options fields.
@@ -50,7 +51,7 @@ protected function setUp() {
     ]);
     $this->fieldStorage->save();
 
-    $this->field = entity_create('field_config', [
+    $this->field = FieldConfig::create([
       'field_name' => $field_name,
       'entity_type' => 'entity_test_rev',
       'bundle' => 'entity_test_rev',
diff --git a/core/modules/options/src/Tests/OptionsFieldTest.php b/core/modules/options/src/Tests/OptionsFieldTest.php
index a7d3ffe..0498b8a 100644
--- a/core/modules/options/src/Tests/OptionsFieldTest.php
+++ b/core/modules/options/src/Tests/OptionsFieldTest.php
@@ -8,6 +8,7 @@
 namespace Drupal\options\Tests;
 
 use Drupal\Core\Entity\Exception\FieldStorageDefinitionUpdateForbiddenException;
+use Drupal\field\Entity\FieldConfig;
 
 /**
  * Tests for the 'Options' field types.
@@ -76,7 +77,7 @@ function testUpdateAllowedValues() {
     // Options are reset when a new field with the same name is created.
     $this->fieldStorage->delete();
     entity_create('field_storage_config', $this->fieldStorageDefinition)->save();
-    entity_create('field_config', array(
+    FieldConfig::create(array(
       'field_name' => $this->fieldName,
       'entity_type' => 'entity_test',
       'bundle' => 'entity_test',
diff --git a/core/modules/options/src/Tests/OptionsFieldUITest.php b/core/modules/options/src/Tests/OptionsFieldUITest.php
index d4219c6..4135fad 100644
--- a/core/modules/options/src/Tests/OptionsFieldUITest.php
+++ b/core/modules/options/src/Tests/OptionsFieldUITest.php
@@ -9,6 +9,7 @@
 
 use Drupal\field\Entity\FieldStorageConfig;
 use Drupal\field\Tests\FieldTestBase;
+use Drupal\field\Entity\FieldConfig;
 
 /**
  * Tests the Options field UI functionality.
@@ -272,7 +273,7 @@ protected function createOptionsField($type) {
       'entity_type' => 'node',
       'type' => $type,
     ))->save();
-    entity_create('field_config', array(
+    FieldConfig::create(array(
       'field_name' => $this->fieldName,
       'entity_type' => 'node',
       'bundle' => $this->type,
diff --git a/core/modules/options/src/Tests/OptionsFieldUnitTestBase.php b/core/modules/options/src/Tests/OptionsFieldUnitTestBase.php
index fcfe4f8..84b572e 100644
--- a/core/modules/options/src/Tests/OptionsFieldUnitTestBase.php
+++ b/core/modules/options/src/Tests/OptionsFieldUnitTestBase.php
@@ -9,6 +9,7 @@
 namespace Drupal\options\Tests;
 
 use Drupal\field\Tests\FieldUnitTestBase;
+use Drupal\field\Entity\FieldConfig;
 
 /**
  * Base class for Options module integration tests.
@@ -69,7 +70,7 @@ protected function setUp() {
     $this->fieldStorage = entity_create('field_storage_config', $this->fieldStorageDefinition);
     $this->fieldStorage->save();
 
-    $this->field = entity_create('field_config', array(
+    $this->field = FieldConfig::create(array(
       'field_storage' => $this->fieldStorage,
       'bundle' => 'entity_test',
     ));
diff --git a/core/modules/options/src/Tests/OptionsWidgetsTest.php b/core/modules/options/src/Tests/OptionsWidgetsTest.php
index 93293ca..d93a8a3 100644
--- a/core/modules/options/src/Tests/OptionsWidgetsTest.php
+++ b/core/modules/options/src/Tests/OptionsWidgetsTest.php
@@ -8,6 +8,7 @@
 namespace Drupal\options\Tests;
 
 use Drupal\field\Tests\FieldTestBase;
+use Drupal\field\Entity\FieldConfig;
 
 /**
  * Tests the Options widgets.
@@ -88,7 +89,7 @@ protected function setUp() {
    */
   function testRadioButtons() {
     // Create an instance of the 'single value' field.
-    $field = entity_create('field_config', [
+    $field = FieldConfig::create([
       'field_storage' => $this->card1,
       'bundle' => 'entity_test',
     ]);
@@ -145,7 +146,7 @@ function testRadioButtons() {
    */
   function testCheckBoxes() {
     // Create an instance of the 'multiple values' field.
-    $field = entity_create('field_config', array(
+    $field = FieldConfig::create(array(
       'field_storage' => $this->card2,
       'bundle' => 'entity_test',
     ));
@@ -234,7 +235,7 @@ function testCheckBoxes() {
    */
   function testSelectListSingle() {
     // Create an instance of the 'single value' field.
-    $field = entity_create('field_config', array(
+    $field = FieldConfig::create(array(
       'field_storage' => $this->card1,
       'bundle' => 'entity_test',
       'required' => TRUE,
@@ -334,7 +335,7 @@ function testSelectListSingle() {
    */
   function testSelectListMultiple() {
     // Create an instance of the 'multiple values' field.
-    $field = entity_create('field_config', array(
+    $field = FieldConfig::create(array(
       'field_storage' => $this->card2,
       'bundle' => 'entity_test',
     ));
@@ -455,7 +456,7 @@ function testSelectListMultiple() {
    */
   function testEmptyValue() {
     // Create an instance of the 'single value' field.
-    $field = entity_create('field_config', [
+    $field = FieldConfig::create([
       'field_storage' => $this->card1,
       'bundle' => 'entity_test',
     ]);
diff --git a/core/modules/options/src/Tests/Views/ViewsDataTest.php b/core/modules/options/src/Tests/Views/ViewsDataTest.php
index b8773a0..490d589 100644
--- a/core/modules/options/src/Tests/Views/ViewsDataTest.php
+++ b/core/modules/options/src/Tests/Views/ViewsDataTest.php
@@ -6,6 +6,8 @@
 
 namespace Drupal\options\Tests\Views;
 
+use Drupal\field\Entity\FieldConfig;
+
 /**
  * Test to ensure views data is properly created for the Options module.
  *
@@ -43,7 +45,7 @@ public function setUp() {
     ]);
     $this->fieldStorage->save();
 
-    $this->field = entity_create('field_config', [
+    $this->field = FieldConfig::create([
       'field_name' => $field_name,
       'entity_type' => 'entity_test',
       'bundle' => 'entity_test',
diff --git a/core/modules/quickedit/src/Tests/QuickEditTestBase.php b/core/modules/quickedit/src/Tests/QuickEditTestBase.php
index eb779ad..b77fe13 100644
--- a/core/modules/quickedit/src/Tests/QuickEditTestBase.php
+++ b/core/modules/quickedit/src/Tests/QuickEditTestBase.php
@@ -8,6 +8,7 @@
 namespace Drupal\quickedit\Tests;
 
 use Drupal\simpletest\KernelTestBase;
+use Drupal\field\Entity\FieldConfig;
 
 /**
  * Base class for testing Quick Edit functionality.
@@ -79,7 +80,7 @@ protected function createFieldWithStorage($field_name, $type, $cardinality, $lab
     $this->fields->$field_storage->save();
 
     $field = $field_name . '_field';
-    $this->fields->$field = entity_create('field_config', array(
+    $this->fields->$field = FieldConfig::create(array(
       'field_storage' => $this->fields->$field_storage,
       'bundle' => 'entity_test',
       'label' => $label,
diff --git a/core/modules/rdf/src/Tests/Field/FieldRdfaTestBase.php b/core/modules/rdf/src/Tests/Field/FieldRdfaTestBase.php
index cb8f584..ecaa933 100644
--- a/core/modules/rdf/src/Tests/Field/FieldRdfaTestBase.php
+++ b/core/modules/rdf/src/Tests/Field/FieldRdfaTestBase.php
@@ -7,6 +7,7 @@
 namespace Drupal\rdf\Tests\Field;
 
 use Drupal\field\Tests\FieldUnitTestBase;
+use Drupal\field\Entity\FieldConfig;
 
 abstract class FieldRdfaTestBase extends FieldUnitTestBase {
 
@@ -119,7 +120,7 @@ protected function createTestField($field_settings = array()) {
       'entity_type' => 'entity_test',
       'type' => $this->fieldType,
     ))->save();
-    entity_create('field_config', array(
+    FieldConfig::create(array(
       'entity_type' => 'entity_test',
       'field_name' => $this->fieldName,
       'bundle' => 'entity_test',
diff --git a/core/modules/serialization/src/Tests/EntityResolverTest.php b/core/modules/serialization/src/Tests/EntityResolverTest.php
index f63d96d..c20eff6 100644
--- a/core/modules/serialization/src/Tests/EntityResolverTest.php
+++ b/core/modules/serialization/src/Tests/EntityResolverTest.php
@@ -7,6 +7,7 @@
 namespace Drupal\serialization\Tests;
 
 use Drupal\Core\Url;
+use Drupal\field\Entity\FieldConfig;
 
 /**
  * Tests that entities references can be resolved.
@@ -45,7 +46,7 @@ protected function setUp() {
     ))->save();
 
     // Create the test field.
-    entity_create('field_config', array(
+    FieldConfig::create(array(
       'entity_type' => 'entity_test_mulrev',
       'field_name' => 'field_test_entity_reference',
       'bundle' => 'entity_test_mulrev',
diff --git a/core/modules/simpletest/src/Tests/KernelTestBaseTest.php b/core/modules/simpletest/src/Tests/KernelTestBaseTest.php
index 2187ccc..23a624e 100644
--- a/core/modules/simpletest/src/Tests/KernelTestBaseTest.php
+++ b/core/modules/simpletest/src/Tests/KernelTestBaseTest.php
@@ -9,6 +9,7 @@
 
 use Drupal\Core\Database\Database;
 use Drupal\simpletest\KernelTestBase;
+use Drupal\field\Entity\FieldConfig;
 
 /**
  * Tests KernelTestBase functionality.
@@ -283,7 +284,7 @@ function testEnableModulesFixedList() {
       'type' => 'test_field'
     ));
     $field_storage->save();
-    entity_create('field_config', array(
+    FieldConfig::create(array(
       'field_storage' => $field_storage,
       'bundle' => 'entity_test',
     ))->save();
diff --git a/core/modules/system/src/Tests/Ajax/MultiFormTest.php b/core/modules/system/src/Tests/Ajax/MultiFormTest.php
index f87100d..a8aae33 100644
--- a/core/modules/system/src/Tests/Ajax/MultiFormTest.php
+++ b/core/modules/system/src/Tests/Ajax/MultiFormTest.php
@@ -8,6 +8,7 @@
 namespace Drupal\system\Tests\Ajax;
 
 use Drupal\Core\Field\FieldStorageDefinitionInterface;
+use Drupal\field\Entity\FieldConfig;
 
 /**
  * Tests that AJAX-enabled forms work when multiple instances of the same form
@@ -37,7 +38,7 @@ protected function setUp() {
       'type' => 'text',
       'cardinality' => FieldStorageDefinitionInterface::CARDINALITY_UNLIMITED,
     ))->save();
-    entity_create('field_config', array(
+    FieldConfig::create(array(
       'field_name' => $field_name,
       'entity_type' => 'node',
       'bundle' => 'page',
diff --git a/core/modules/system/src/Tests/Entity/EntityCacheTagsTestBase.php b/core/modules/system/src/Tests/Entity/EntityCacheTagsTestBase.php
index dd35bbd..d822687 100644
--- a/core/modules/system/src/Tests/Entity/EntityCacheTagsTestBase.php
+++ b/core/modules/system/src/Tests/Entity/EntityCacheTagsTestBase.php
@@ -79,7 +79,7 @@ protected function setUp() {
         'type' => 'test_field',
         'settings' => array(),
       ))->save();
-      entity_create('field_config', array(
+      FieldConfig::create(array(
         'entity_type' => $this->entity->getEntityTypeId(),
         'bundle' => $this->entity->bundle(),
         'field_name' => 'configurable_field',
@@ -255,7 +255,7 @@ protected function createReferenceTestEntities($referenced_entity) {
         'target_type' => $referenced_entity->getEntityTypeId(),
       ),
     ))->save();
-    entity_create('field_config', array(
+    FieldConfig::create(array(
       'field_name' => $field_name,
       'entity_type' => $entity_type,
       'bundle' => $bundle,
diff --git a/core/modules/system/src/Tests/Entity/EntityLanguageTestBase.php b/core/modules/system/src/Tests/Entity/EntityLanguageTestBase.php
index 61a5ad2..b19ea0a 100644
--- a/core/modules/system/src/Tests/Entity/EntityLanguageTestBase.php
+++ b/core/modules/system/src/Tests/Entity/EntityLanguageTestBase.php
@@ -81,7 +81,7 @@ protected function setUp() {
         'type' => 'text',
         'cardinality' => 4,
       ))->save();
-      entity_create('field_config', array(
+      FieldConfig::create(array(
         'field_name' => $this->fieldName,
         'entity_type' => $entity_type,
         'bundle' => $entity_type,
@@ -95,7 +95,7 @@ protected function setUp() {
         'type' => 'text',
         'cardinality' => 4,
       ))->save();
-      entity_create('field_config', array(
+      FieldConfig::create(array(
         'field_name' => $this->untranslatableFieldName,
         'entity_type' => $entity_type,
         'bundle' => $entity_type,
diff --git a/core/modules/system/src/Tests/Entity/EntityQueryAggregateTest.php b/core/modules/system/src/Tests/Entity/EntityQueryAggregateTest.php
index a3262ea..602d773 100644
--- a/core/modules/system/src/Tests/Entity/EntityQueryAggregateTest.php
+++ b/core/modules/system/src/Tests/Entity/EntityQueryAggregateTest.php
@@ -6,6 +6,8 @@
  */
 namespace Drupal\system\Tests\Entity;
 
+use Drupal\field\Entity\FieldConfig;
+
 /**
  * Tests the Entity Query Aggregation API.
  *
@@ -57,7 +59,7 @@ protected function setUp() {
         'type' => 'integer',
         'cardinality' => 2,
       ))->save();
-      entity_create('field_config', array(
+      FieldConfig::create(array(
         'field_name' => $field_name,
         'entity_type' => 'entity_test',
         'bundle' => 'entity_test',
diff --git a/core/modules/system/src/Tests/Entity/EntityQueryTest.php b/core/modules/system/src/Tests/Entity/EntityQueryTest.php
index 3124f54..66799e1 100644
--- a/core/modules/system/src/Tests/Entity/EntityQueryTest.php
+++ b/core/modules/system/src/Tests/Entity/EntityQueryTest.php
@@ -89,7 +89,7 @@ protected function setUp() {
       } while ($bundles && strtolower($bundles[0]) >= strtolower($bundle));
       entity_test_create_bundle($bundle);
       foreach ($field_storages as $field_storage) {
-        entity_create('field_config', array(
+        FieldConfig::create(array(
           'field_storage' => $field_storage,
           'bundle' => $bundle,
         ))->save();
@@ -467,7 +467,7 @@ public function testCount() {
     ));
     $field_storage->save();
     $bundle = $this->randomMachineName();
-    entity_create('field_config', array(
+    FieldConfig::create(array(
       'field_storage' => $field_storage,
       'bundle' => $bundle,
     ))->save();
diff --git a/core/modules/system/src/Tests/Entity/EntityReferenceSelection/EntityReferenceSelectionSortTest.php b/core/modules/system/src/Tests/Entity/EntityReferenceSelection/EntityReferenceSelectionSortTest.php
index 3d0d4d1..65caeaa 100644
--- a/core/modules/system/src/Tests/Entity/EntityReferenceSelection/EntityReferenceSelectionSortTest.php
+++ b/core/modules/system/src/Tests/Entity/EntityReferenceSelection/EntityReferenceSelectionSortTest.php
@@ -11,6 +11,7 @@
 use Drupal\node\Entity\Node;
 use Drupal\node\Entity\NodeType;
 use Drupal\system\Tests\Entity\EntityUnitTestBase;
+use Drupal\field\Entity\FieldConfig;
 
 /**
  * Tests sorting referenced items.
@@ -52,7 +53,7 @@ public function testSort() {
       'entity_types' => array('node'),
     ))->save();
 
-    entity_create('field_config', array(
+    FieldConfig::create(array(
       'label' => 'Text Field',
       'field_name' => 'field_text',
       'entity_type' => 'node',
diff --git a/core/modules/system/src/Tests/Entity/FieldSqlStorageTest.php b/core/modules/system/src/Tests/Entity/FieldSqlStorageTest.php
index 67b0e94..f268ba9 100644
--- a/core/modules/system/src/Tests/Entity/FieldSqlStorageTest.php
+++ b/core/modules/system/src/Tests/Entity/FieldSqlStorageTest.php
@@ -11,6 +11,7 @@
 use Drupal\Core\Database\Database;
 use Drupal\Core\Entity\Exception\FieldStorageDefinitionUpdateForbiddenException;
 use Drupal\field\Entity\FieldStorageConfig;
+use Drupal\field\Entity\FieldConfig;
 
 /**
  * Tests Field SQL Storage .
@@ -91,7 +92,7 @@ protected function setUp() {
       'cardinality' => $this->fieldCardinality,
     ));
     $this->fieldStorage->save();
-    $this->field = entity_create('field_config', array(
+    $this->field = FieldConfig::create(array(
       'field_storage' => $this->fieldStorage,
       'bundle' => $entity_type
     ));
@@ -287,7 +288,7 @@ function testLongNames() {
         'entity_type' => $entity_type,
         'type' => 'test_field',
       ))->save();
-      entity_create('field_config', array(
+      FieldConfig::create(array(
         'field_name' => $field_names[$i],
         'entity_type' => $entity_type,
         'bundle' => $bundle,
@@ -319,7 +320,7 @@ function testUpdateFieldSchemaWithData() {
       'settings' => array('precision' => 5, 'scale' => 2),
     ));
     $field_storage->save();
-    $field = entity_create('field_config', array(
+    $field = FieldConfig::create(array(
       'field_storage' => $field_storage,
       'bundle' => $entity_type,
     ));
@@ -393,7 +394,7 @@ function testFieldUpdateIndexesWithData() {
       'type' => 'text',
     ));
     $field_storage->save();
-    $field = entity_create('field_config', array(
+    $field = FieldConfig::create(array(
       'field_storage' => $field_storage,
       'bundle' => $entity_type,
     ));
diff --git a/core/modules/system/src/Tests/Form/ArbitraryRebuildTest.php b/core/modules/system/src/Tests/Form/ArbitraryRebuildTest.php
index 09eba7b..2cbda66 100644
--- a/core/modules/system/src/Tests/Form/ArbitraryRebuildTest.php
+++ b/core/modules/system/src/Tests/Form/ArbitraryRebuildTest.php
@@ -8,6 +8,7 @@
 namespace Drupal\system\Tests\Form;
 
 use Drupal\simpletest\WebTestBase;
+use Drupal\field\Entity\FieldConfig;
 
 /**
  * Tests altering forms to be rebuilt so there are multiple steps.
@@ -34,7 +35,7 @@ protected function setUp() {
       'cardinality' => -1,
       'translatable' => FALSE,
     ))->save();
-    entity_create('field_config', array(
+    FieldConfig::create(array(
       'entity_type' => 'user',
       'field_name' => 'test_multiple',
       'bundle' => 'user',
diff --git a/core/modules/system/src/Tests/Form/RebuildTest.php b/core/modules/system/src/Tests/Form/RebuildTest.php
index 7674241..59aa02a 100644
--- a/core/modules/system/src/Tests/Form/RebuildTest.php
+++ b/core/modules/system/src/Tests/Form/RebuildTest.php
@@ -10,6 +10,7 @@
 use Drupal\Core\Field\FieldStorageDefinitionInterface;
 use Drupal\Core\Url;
 use Drupal\simpletest\WebTestBase;
+use Drupal\field\Entity\FieldConfig;
 
 /**
  * Tests functionality of \Drupal\Core\Form\FormBuilderInterface::rebuildForm().
@@ -79,7 +80,7 @@ function testPreserveFormActionAfterAJAX() {
       'type' => 'text',
       'cardinality' => FieldStorageDefinitionInterface::CARDINALITY_UNLIMITED,
     ))->save();
-    entity_create('field_config', array(
+    FieldConfig::create(array(
       'field_name' => $field_name,
       'entity_type' => 'node',
       'bundle' => 'page',
diff --git a/core/modules/system/tests/modules/entity_test/entity_test.install b/core/modules/system/tests/modules/entity_test/entity_test.install
index a9ff423..fbc7ba2 100644
--- a/core/modules/system/tests/modules/entity_test/entity_test.install
+++ b/core/modules/system/tests/modules/entity_test/entity_test.install
@@ -6,6 +6,7 @@
  */
 
 use Drupal\system\Tests\Update\DbUpdatesTrait;
+use Drupal\field\Entity\FieldConfig;
 
 /**
  * Implements hook_install().
@@ -19,7 +20,7 @@ function entity_test_install() {
       'type' => 'text',
       'cardinality' => 1,
     ))->save();
-    entity_create('field_config', array(
+    FieldConfig::create(array(
       'entity_type' => $entity_type,
       'field_name' => 'field_test_text',
       'bundle' => $entity_type,
diff --git a/core/modules/taxonomy/src/Tests/TaxonomyImageTest.php b/core/modules/taxonomy/src/Tests/TaxonomyImageTest.php
index 550c5f5..dfa4ff3 100644
--- a/core/modules/taxonomy/src/Tests/TaxonomyImageTest.php
+++ b/core/modules/taxonomy/src/Tests/TaxonomyImageTest.php
@@ -9,6 +9,7 @@
 
 use Drupal\user\RoleInterface;
 use Drupal\file\Entity\File;
+use Drupal\field\Entity\FieldConfig;
 
 /**
  * Tests access checks of private image fields.
@@ -49,7 +50,7 @@ protected function setUp() {
         'uri_scheme' => 'private',
       ),
     ))->save();
-    entity_create('field_config', array(
+    FieldConfig::create(array(
       'field_name' => $name,
       'entity_type' => $entity_type,
       'bundle' => $this->vocabulary->id(),
diff --git a/core/modules/taxonomy/src/Tests/Views/TaxonomyFieldFilterTest.php b/core/modules/taxonomy/src/Tests/Views/TaxonomyFieldFilterTest.php
index 5dec796..75d3ea2 100644
--- a/core/modules/taxonomy/src/Tests/Views/TaxonomyFieldFilterTest.php
+++ b/core/modules/taxonomy/src/Tests/Views/TaxonomyFieldFilterTest.php
@@ -12,6 +12,7 @@
 use Drupal\views\Tests\ViewTestBase;
 use Drupal\views\Tests\ViewTestData;
 use Drupal\views\Views;
+use Drupal\field\Entity\FieldConfig;
 
 /**
  * Tests taxonomy field filters with translations.
@@ -74,7 +75,7 @@ function setUp() {
       'type' => 'text',
     ));
     $field->save();
-    entity_create('field_config', array(
+    FieldConfig::create(array(
       'field_name' => 'field_foo',
       'entity_type' => 'taxonomy_term',
       'label' => 'Foo',
diff --git a/core/modules/taxonomy/src/Tests/VocabularyCrudTest.php b/core/modules/taxonomy/src/Tests/VocabularyCrudTest.php
index 6596b8e..9666771 100644
--- a/core/modules/taxonomy/src/Tests/VocabularyCrudTest.php
+++ b/core/modules/taxonomy/src/Tests/VocabularyCrudTest.php
@@ -9,6 +9,7 @@
 
 use Drupal\Component\Utility\Unicode;
 use Drupal\taxonomy\Entity\Vocabulary;
+use Drupal\field\Entity\FieldConfig;
 
 /**
  * Tests loading, saving and deleting vocabularies.
@@ -161,7 +162,7 @@ function testUninstallReinstall() {
       'bundle' => $this->vocabulary->id(),
       'label' => $this->randomMachineName() . '_label',
     );
-    entity_create('field_config', $field_definition)->save();
+    FieldConfig::create($field_definition)->save();
 
     // Remove the third party setting from the memory copy of the vocabulary.
     // We keep this invalid copy around while the taxonomy module is not even
@@ -179,6 +180,6 @@ function testUninstallReinstall() {
     $this->vocabulary->enforceIsNew();
     $this->vocabulary->save();
     entity_create('field_storage_config', $storage_definition)->save();
-    entity_create('field_config', $field_definition)->save();
+    FieldConfig::create($field_definition)->save();
   }
 }
diff --git a/core/modules/telephone/src/Tests/TelephoneFieldTest.php b/core/modules/telephone/src/Tests/TelephoneFieldTest.php
index 515d7e0..4224146 100644
--- a/core/modules/telephone/src/Tests/TelephoneFieldTest.php
+++ b/core/modules/telephone/src/Tests/TelephoneFieldTest.php
@@ -8,6 +8,7 @@
 namespace Drupal\telephone\Tests;
 
 use Drupal\simpletest\WebTestBase;
+use Drupal\field\Entity\FieldConfig;
 
 /**
  * Tests the creation of telephone fields.
@@ -55,7 +56,7 @@ function testTelephoneField() {
       'entity_type' => 'node',
       'type' => 'telephone',
     ))->save();
-    entity_create('field_config', array(
+    FieldConfig::create(array(
       'field_name' => 'field_telephone',
       'label' => 'Telephone Number',
       'entity_type' => 'node',
diff --git a/core/modules/telephone/src/Tests/TelephoneItemTest.php b/core/modules/telephone/src/Tests/TelephoneItemTest.php
index 42b7973..9e6cc8a 100644
--- a/core/modules/telephone/src/Tests/TelephoneItemTest.php
+++ b/core/modules/telephone/src/Tests/TelephoneItemTest.php
@@ -10,6 +10,7 @@
 use Drupal\Core\Field\FieldItemListInterface;
 use Drupal\Core\Field\FieldItemInterface;
 use Drupal\field\Tests\FieldUnitTestBase;
+use Drupal\field\Entity\FieldConfig;
 
 /**
  * Tests the new entity API for the telephone field type.
@@ -34,7 +35,7 @@ protected function setUp() {
       'entity_type' => 'entity_test',
       'type' => 'telephone',
     ))->save();
-    entity_create('field_config', array(
+    FieldConfig::create(array(
       'entity_type' => 'entity_test',
       'field_name' => 'field_test',
       'bundle' => 'entity_test',
diff --git a/core/modules/text/src/Tests/Formatter/TextFormatterTest.php b/core/modules/text/src/Tests/Formatter/TextFormatterTest.php
index 324f2cf..6ace789 100644
--- a/core/modules/text/src/Tests/Formatter/TextFormatterTest.php
+++ b/core/modules/text/src/Tests/Formatter/TextFormatterTest.php
@@ -9,6 +9,7 @@
 
 use Drupal\filter\Entity\FilterFormat;
 use Drupal\system\Tests\Entity\EntityUnitTestBase;
+use Drupal\field\Entity\FieldConfig;
 
 /**
  * Tests the text formatters functionality.
@@ -61,7 +62,7 @@ protected function setUp() {
       'type' => 'text',
       'settings' => array(),
     ))->save();
-    entity_create('field_config', array(
+    FieldConfig::create(array(
       'entity_type' => $this->entityType,
       'bundle' => $this->bundle,
       'field_name' => 'formatted_text',
diff --git a/core/modules/text/src/Tests/TextFieldTest.php b/core/modules/text/src/Tests/TextFieldTest.php
index 8279a6d..377af84 100644
--- a/core/modules/text/src/Tests/TextFieldTest.php
+++ b/core/modules/text/src/Tests/TextFieldTest.php
@@ -9,6 +9,7 @@
 
 use Drupal\Component\Utility\Unicode;
 use Drupal\field\Tests\String\StringFieldTest;
+use Drupal\field\Entity\FieldConfig;
 
 /**
  * Tests the creation of text fields.
@@ -48,7 +49,7 @@ function testTextFieldValidation() {
       )
     ));
     $field_storage->save();
-    entity_create('field_config', array(
+    FieldConfig::create(array(
       'field_storage' => $field_storage,
       'bundle' => 'entity_test',
     ))->save();
@@ -79,7 +80,7 @@ function testRequiredLongTextWithFileUpload() {
       'type' => 'text_with_summary',
     ));
     $field_storage->save();
-    entity_create('field_config', array(
+    FieldConfig::create(array(
       'field_storage' => $field_storage,
       'bundle' => 'entity_test',
       'label' => $this->randomMachineName() . '_label',
@@ -94,7 +95,7 @@ function testRequiredLongTextWithFileUpload() {
       'type' => 'file'
     ));
     $field_storage->save();
-    entity_create('field_config', array(
+    FieldConfig::create(array(
       'field_storage' => $field_storage,
       'bundle' => 'entity_test',
       'label' => $this->randomMachineName() . '_label',
@@ -157,7 +158,7 @@ function _testTextfieldWidgetsFormatted($field_type, $widget_type) {
       'type' => $field_type
     ));
     $field_storage->save();
-    entity_create('field_config', array(
+    FieldConfig::create(array(
       'field_storage' => $field_storage,
       'bundle' => 'entity_test',
       'label' => $this->randomMachineName() . '_label',
diff --git a/core/modules/text/src/Tests/TextWithSummaryItemTest.php b/core/modules/text/src/Tests/TextWithSummaryItemTest.php
index e292ffd..a8d5d2c 100644
--- a/core/modules/text/src/Tests/TextWithSummaryItemTest.php
+++ b/core/modules/text/src/Tests/TextWithSummaryItemTest.php
@@ -10,6 +10,7 @@
 use Drupal\Core\Field\FieldItemListInterface;
 use Drupal\Core\Field\FieldItemInterface;
 use Drupal\field\Tests\FieldUnitTestBase;
+use Drupal\field\Entity\FieldConfig;
 
 /**
  * Tests using entity fields of the text summary field type.
@@ -107,7 +108,7 @@ protected function createField($entity_type) {
       )
     ));
     $this->fieldStorage->save();
-    $this->field = entity_create('field_config', array(
+    $this->field = FieldConfig::create(array(
       'field_storage' => $this->fieldStorage,
       'bundle' => $entity_type,
     ));
diff --git a/core/modules/user/src/Tests/UserCreateTest.php b/core/modules/user/src/Tests/UserCreateTest.php
index 2674f09..4d0e9f0 100644
--- a/core/modules/user/src/Tests/UserCreateTest.php
+++ b/core/modules/user/src/Tests/UserCreateTest.php
@@ -8,6 +8,7 @@
 namespace Drupal\user\Tests;
 
 use Drupal\simpletest\WebTestBase;
+use Drupal\field\Entity\FieldConfig;
 
 /**
  * Tests the create user administration page.
@@ -49,7 +50,7 @@ public function testUserAdd() {
       ),
     ))->save();
 
-    entity_create('field_config', array(
+    FieldConfig::create(array(
       'field_name' => $field_name,
       'entity_type' => 'user',
       'label' => 'Picture',
diff --git a/core/modules/user/src/Tests/UserRegistrationTest.php b/core/modules/user/src/Tests/UserRegistrationTest.php
index 1e16bc7..08208f3 100644
--- a/core/modules/user/src/Tests/UserRegistrationTest.php
+++ b/core/modules/user/src/Tests/UserRegistrationTest.php
@@ -295,7 +295,7 @@ function testRegistrationWithUserFields() {
       'cardinality' => 1,
     ));
     $field_storage->save();
-    $field = entity_create('field_config', array(
+    $field = FieldConfig::create(array(
       'field_storage' => $field_storage,
       'label' => 'Some user field',
       'bundle' => 'user',
diff --git a/core/modules/views/src/Tests/Entity/ViewEntityDependenciesTest.php b/core/modules/views/src/Tests/Entity/ViewEntityDependenciesTest.php
index 632be6a..c5e9bd1 100644
--- a/core/modules/views/src/Tests/Entity/ViewEntityDependenciesTest.php
+++ b/core/modules/views/src/Tests/Entity/ViewEntityDependenciesTest.php
@@ -12,6 +12,7 @@
 use Drupal\views\Tests\ViewTestData;
 use Drupal\views\Tests\ViewKernelTestBase;
 use Drupal\views\Views;
+use Drupal\field\Entity\FieldConfig;
 
 /**
  * Tests the calculation of dependencies for views.
@@ -63,7 +64,7 @@ protected function setUp() {
       'type' => 'comment',
     ));
     $field_storage->save();
-    entity_create('field_config', array(
+    FieldConfig::create(array(
       'field_storage' => $field_storage,
       'bundle' => $content_type->id(),
       'label' => $this->randomMachineName() . '_label',
@@ -72,7 +73,7 @@ protected function setUp() {
         'comment_type' => $comment_type->id(),
       ),
     ))->save();
-    entity_create('field_config', array(
+    FieldConfig::create(array(
       'field_storage' => FieldStorageConfig::loadByName('node', 'body'),
       'bundle' => $content_type->id(),
       'label' => $this->randomMachineName() . '_body',
diff --git a/core/modules/views/src/Tests/FieldApiDataTest.php b/core/modules/views/src/Tests/FieldApiDataTest.php
index 72ee0be..68e1250 100644
--- a/core/modules/views/src/Tests/FieldApiDataTest.php
+++ b/core/modules/views/src/Tests/FieldApiDataTest.php
@@ -30,7 +30,7 @@ protected function setUp() {
       'bundle' => 'page',
       'label' => 'GiraffeA" label'
     );
-    entity_create('field_config', $field)->save();
+    FieldConfig::create($field)->save();
 
     // Attach the same field to a different bundle with a different label.
     $this->drupalCreateContentType(['type' => 'article']);
diff --git a/core/modules/views/src/Tests/Handler/FieldGroupRowsTest.php b/core/modules/views/src/Tests/Handler/FieldGroupRowsTest.php
index 9cfd854..78c53c4 100644
--- a/core/modules/views/src/Tests/Handler/FieldGroupRowsTest.php
+++ b/core/modules/views/src/Tests/Handler/FieldGroupRowsTest.php
@@ -10,6 +10,7 @@
 use Drupal\Core\Field\FieldStorageDefinitionInterface;
 use Drupal\Core\Render\RenderContext;
 use Drupal\views\Views;
+use Drupal\field\Entity\FieldConfig;
 
 /**
  * Tests the "Display all values in the same row" setting.
@@ -61,7 +62,7 @@ protected function setUp() {
       'field_storage' => $field_storage,
       'bundle' => $node_type->id(),
     );
-    entity_create('field_config', $field)->save();
+    FieldConfig::create($field)->save();
   }
 
   /**
diff --git a/core/modules/views/src/Tests/Wizard/TaggedWithTest.php b/core/modules/views/src/Tests/Wizard/TaggedWithTest.php
index e62c1737..3e1616c 100644
--- a/core/modules/views/src/Tests/Wizard/TaggedWithTest.php
+++ b/core/modules/views/src/Tests/Wizard/TaggedWithTest.php
@@ -9,6 +9,7 @@
 
 use Drupal\Core\Field\FieldStorageDefinitionInterface;
 use Drupal\field\Tests\EntityReference\EntityReferenceTestTrait;
+use Drupal\field\Entity\FieldConfig;
 
 /**
  * Tests the ability of the views wizard to create views filtered by taxonomy.
@@ -201,7 +202,7 @@ function testTaggedWithByNodeType() {
 
     // If we add an instance of the tagging field to the second node type, the
     // "tagged with" form element should not appear for it too.
-    entity_create('field_config', array(
+    FieldConfig::create(array(
       'field_name' => $this->tagFieldName,
       'entity_type' => 'node',
       'bundle' => $this->nodeTypeWithoutTags->id(),
-- 
2.1.4

