summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNathaniel Catchpole2016-02-08 23:52:18 (GMT)
committerNathaniel Catchpole2016-02-08 23:52:18 (GMT)
commitd4e7281f28cb40bc1d13119eab7f48947f34fefa (patch)
tree2b3773b403571996c42679abac27f6383cac4732
parentea08d10ec7336f2d29c4c56b4a33d8785959e403 (diff)
Issue #2641586 by Mac_Weber, marvin_B8: Replace deprecated usage of entity_create('field_storage_config') with a direct call to FieldStorageConfig::create()
-rw-r--r--core/modules/comment/src/Tests/CommentStringIdEntitiesTest.php3
-rw-r--r--core/modules/config/src/Tests/ConfigExportImportUITest.php2
-rw-r--r--core/modules/contact/src/Tests/Views/ContactFieldsTest.php3
-rw-r--r--core/modules/content_translation/src/Tests/ContentTranslationContextualLinksTest.php3
-rw-r--r--core/modules/content_translation/src/Tests/ContentTranslationSyncImageTest.php3
-rw-r--r--core/modules/content_translation/src/Tests/ContentTranslationTestBase.php3
-rw-r--r--core/modules/datetime/src/Tests/DateTimeFieldTest.php5
-rw-r--r--core/modules/datetime/src/Tests/DateTimeItemTest.php3
-rw-r--r--core/modules/datetime/src/Tests/Views/DateTimeHandlerTestBase.php3
-rw-r--r--core/modules/field/src/Entity/FieldStorageConfig.php3
-rw-r--r--core/modules/field/src/Tests/Boolean/BooleanItemTest.php3
-rw-r--r--core/modules/field/src/Tests/BulkDeleteTest.php5
-rw-r--r--core/modules/field/src/Tests/DisplayApiTest.php3
-rw-r--r--core/modules/field/src/Tests/Email/EmailFieldTest.php3
-rw-r--r--core/modules/field/src/Tests/Email/EmailItemTest.php3
-rw-r--r--core/modules/field/src/Tests/EntityReference/EntityReferenceAutoCreateTest.php3
-rw-r--r--core/modules/field/src/Tests/EntityReference/EntityReferenceFieldDefaultValueTest.php4
-rw-r--r--core/modules/field/src/Tests/EntityReference/EntityReferenceFieldTranslatedReferenceViewTest.php3
-rw-r--r--core/modules/field/src/Tests/EntityReference/EntityReferenceFileUploadTest.php5
-rw-r--r--core/modules/field/src/Tests/EntityReference/EntityReferenceFormatterTest.php2
-rw-r--r--core/modules/field/src/Tests/EntityReference/Views/SelectionTest.php3
-rw-r--r--core/modules/field/src/Tests/FieldAccessTest.php4
-rw-r--r--core/modules/field/src/Tests/FieldAttachStorageTest.php5
-rw-r--r--core/modules/field/src/Tests/FieldCrudTest.php6
-rw-r--r--core/modules/field/src/Tests/FieldDataCountTest.php2
-rw-r--r--core/modules/field/src/Tests/FieldImportDeleteUninstallTest.php8
-rw-r--r--core/modules/field/src/Tests/FieldImportDeleteUninstallUiTest.php6
-rw-r--r--core/modules/field/src/Tests/FieldStorageCrudTest.php40
-rw-r--r--core/modules/field/src/Tests/FieldUnitTestBase.php3
-rw-r--r--core/modules/field/src/Tests/FormTest.php24
-rw-r--r--core/modules/field/src/Tests/NestedFormTest.php5
-rw-r--r--core/modules/field/src/Tests/Number/NumberFieldTest.php15
-rw-r--r--core/modules/field/src/Tests/Number/NumberItemTest.php3
-rw-r--r--core/modules/field/src/Tests/ShapeItemTest.php3
-rw-r--r--core/modules/field/src/Tests/String/StringFieldTest.php3
-rw-r--r--core/modules/field/src/Tests/TestItemTest.php3
-rw-r--r--core/modules/field/src/Tests/TestItemWithDependenciesTest.php4
-rw-r--r--core/modules/field/src/Tests/TranslationTest.php5
-rw-r--r--core/modules/field/src/Tests/TranslationWebTest.php2
-rw-r--r--core/modules/field/src/Tests/Views/FieldTestBase.php3
-rw-r--r--core/modules/field/src/Tests/Views/HandlerFieldFieldTest.php9
-rw-r--r--core/modules/field/src/Tests/reEnableModuleFieldTest.php3
-rw-r--r--core/modules/field/tests/modules/field_test/field_test.module3
-rw-r--r--core/modules/file/src/Tests/FileFieldTestBase.php2
-rw-r--r--core/modules/file/src/Tests/FileItemTest.php3
-rw-r--r--core/modules/file/src/Tests/Views/RelationshipUserFileDataTest.php3
-rw-r--r--core/modules/hal/src/Tests/NormalizerTestBase.php7
-rw-r--r--core/modules/image/src/Tests/ImageFieldDefaultImagesTest.php3
-rw-r--r--core/modules/image/src/Tests/ImageFieldTestBase.php3
-rw-r--r--core/modules/image/src/Tests/ImageItemTest.php3
-rw-r--r--core/modules/image/src/Tests/ImageThemeFunctionTest.php3
-rw-r--r--core/modules/image/src/Tests/Views/RelationshipUserImageDataTest.php3
-rw-r--r--core/modules/link/src/Tests/LinkFieldTest.php9
-rw-r--r--core/modules/node/src/Tests/MultiStepNodeFormBasicOptionsTest.php3
-rw-r--r--core/modules/node/src/Tests/NodeAccessFieldTest.php3
-rw-r--r--core/modules/node/src/Tests/NodeAccessLanguageAwareCombinationTest.php3
-rw-r--r--core/modules/node/src/Tests/NodeAccessLanguageAwareTest.php3
-rw-r--r--core/modules/options/src/Tests/OptionsDynamicValuesTestBase.php3
-rw-r--r--core/modules/options/src/Tests/OptionsFieldTest.php3
-rw-r--r--core/modules/options/src/Tests/OptionsFieldUITest.php2
-rw-r--r--core/modules/options/src/Tests/OptionsFieldUnitTestBase.php3
-rw-r--r--core/modules/options/src/Tests/OptionsWidgetsTest.php5
-rw-r--r--core/modules/options/src/Tests/Views/ViewsDataTest.php4
-rw-r--r--core/modules/quickedit/src/Tests/QuickEditTestBase.php3
-rw-r--r--core/modules/rdf/src/Tests/Field/FieldRdfaTestBase.php3
-rw-r--r--core/modules/serialization/src/Tests/EntityResolverTest.php3
-rw-r--r--core/modules/simpletest/src/Tests/KernelTestBaseTest.php3
-rw-r--r--core/modules/system/src/Tests/Ajax/MultiFormTest.php3
-rw-r--r--core/modules/system/src/Tests/Entity/EntityCacheTagsTestBase.php4
-rw-r--r--core/modules/system/src/Tests/Entity/EntityLanguageTestBase.php5
-rw-r--r--core/modules/system/src/Tests/Entity/EntityQueryAggregateTest.php4
-rw-r--r--core/modules/system/src/Tests/Entity/EntityQueryTest.php4
-rw-r--r--core/modules/system/src/Tests/Entity/EntityReferenceSelection/EntityReferenceSelectionSortTest.php3
-rw-r--r--core/modules/system/src/Tests/Entity/FieldSqlStorageTest.php24
-rw-r--r--core/modules/system/src/Tests/Form/ArbitraryRebuildTest.php3
-rw-r--r--core/modules/system/src/Tests/Form/RebuildTest.php3
-rw-r--r--core/modules/system/tests/modules/entity_test/entity_test.install3
-rw-r--r--core/modules/taxonomy/src/Tests/TaxonomyImageTest.php3
-rw-r--r--core/modules/taxonomy/src/Tests/Views/TaxonomyFieldFilterTest.php3
-rw-r--r--core/modules/taxonomy/src/Tests/VocabularyCrudTest.php5
-rw-r--r--core/modules/telephone/src/Tests/TelephoneFieldTest.php3
-rw-r--r--core/modules/telephone/src/Tests/TelephoneItemTest.php3
-rw-r--r--core/modules/text/src/Tests/Formatter/TextFormatterTest.php3
-rw-r--r--core/modules/text/src/Tests/TextFieldTest.php9
-rw-r--r--core/modules/text/src/Tests/TextWithSummaryItemTest.php3
-rw-r--r--core/modules/user/src/Tests/UserCreateTest.php3
-rw-r--r--core/modules/user/src/Tests/UserRegistrationTest.php2
-rw-r--r--core/modules/views/src/Tests/Entity/ViewEntityDependenciesTest.php2
-rw-r--r--core/modules/views/src/Tests/Handler/FieldGroupRowsTest.php3
89 files changed, 244 insertions, 164 deletions
diff --git a/core/modules/comment/src/Tests/CommentStringIdEntitiesTest.php b/core/modules/comment/src/Tests/CommentStringIdEntitiesTest.php
index 0285432..ef7f48d 100644
--- a/core/modules/comment/src/Tests/CommentStringIdEntitiesTest.php
+++ b/core/modules/comment/src/Tests/CommentStringIdEntitiesTest.php
@@ -9,6 +9,7 @@ namespace Drupal\comment\Tests;
use Drupal\comment\Entity\CommentType;
use Drupal\simpletest\KernelTestBase;
+use Drupal\field\Entity\FieldStorageConfig;
/**
* Tests that comment fields cannot be added to entities with non-integer IDs.
@@ -51,7 +52,7 @@ class CommentStringIdEntitiesTest extends KernelTestBase {
'target_entity_type_id' => 'entity_test_string_id',
));
$bundle->save();
- $field_storage = entity_create('field_storage_config', array(
+ $field_storage = FieldStorageConfig::create(array(
'field_name' => 'foo',
'entity_type' => 'entity_test_string_id',
'settings' => array(
diff --git a/core/modules/config/src/Tests/ConfigExportImportUITest.php b/core/modules/config/src/Tests/ConfigExportImportUITest.php
index d72c718..4dd6d8f 100644
--- a/core/modules/config/src/Tests/ConfigExportImportUITest.php
+++ b/core/modules/config/src/Tests/ConfigExportImportUITest.php
@@ -108,7 +108,7 @@ class ConfigExportImportUITest extends WebTestBase {
// Create a field.
$this->fieldName = Unicode::strtolower($this->randomMachineName());
- $this->fieldStorage = entity_create('field_storage_config', array(
+ $this->fieldStorage = FieldStorageConfig::create(array(
'field_name' => $this->fieldName,
'entity_type' => 'node',
'type' => 'text',
diff --git a/core/modules/contact/src/Tests/Views/ContactFieldsTest.php b/core/modules/contact/src/Tests/Views/ContactFieldsTest.php
index 014e968..c04a145 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\FieldStorageConfig;
/**
* Tests which checks that no fieldapi fields are added on contact.
@@ -33,7 +34,7 @@ class ContactFieldsTest extends ViewTestBase {
protected function setUp() {
parent::setUp();
- $this->fieldStorage = entity_create('field_storage_config', array(
+ $this->fieldStorage = FieldStorageConfig::create(array(
'field_name' => strtolower($this->randomMachineName()),
'entity_type' => 'contact_message',
'type' => 'text'
diff --git a/core/modules/content_translation/src/Tests/ContentTranslationContextualLinksTest.php b/core/modules/content_translation/src/Tests/ContentTranslationContextualLinksTest.php
index edccaf0..ae0a888 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\Component\Serialization\Json;
use Drupal\language\Entity\ConfigurableLanguage;
use Drupal\node\Entity\NodeType;
use Drupal\simpletest\WebTestBase;
+use Drupal\field\Entity\FieldStorageConfig;
/**
* Tests that contextual links are available for content translation.
@@ -72,7 +73,7 @@ class ContentTranslationContextualLinksTest extends WebTestBase {
$this->contentType = $this->drupalCreateContentType(array('type' => $this->bundle));
// Add a field to the content type. The field is not yet translatable.
- entity_create('field_storage_config', array(
+ FieldStorageConfig::create(array(
'field_name' => 'field_test_text',
'entity_type' => 'node',
'type' => 'text',
diff --git a/core/modules/content_translation/src/Tests/ContentTranslationSyncImageTest.php b/core/modules/content_translation/src/Tests/ContentTranslationSyncImageTest.php
index 56b1ed5..ea80e27 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\FieldStorageConfig;
/**
* Tests the field synchronization behavior for the image field.
@@ -49,7 +50,7 @@ class ContentTranslationSyncImageTest extends ContentTranslationTestBase {
$this->fieldName = 'field_test_et_ui_image';
$this->cardinality = 3;
- entity_create('field_storage_config', array(
+ FieldStorageConfig::create(array(
'field_name' => $this->fieldName,
'entity_type' => $this->entityTypeId,
'type' => 'image',
diff --git a/core/modules/content_translation/src/Tests/ContentTranslationTestBase.php b/core/modules/content_translation/src/Tests/ContentTranslationTestBase.php
index d00b378..f7a4d65 100644
--- a/core/modules/content_translation/src/Tests/ContentTranslationTestBase.php
+++ b/core/modules/content_translation/src/Tests/ContentTranslationTestBase.php
@@ -10,6 +10,7 @@ namespace Drupal\content_translation\Tests;
use Drupal\Core\Entity\Sql\SqlContentEntityStorage;
use Drupal\language\Entity\ConfigurableLanguage;
use Drupal\simpletest\WebTestBase;
+use Drupal\field\Entity\FieldStorageConfig;
/**
* Base class for content translation tests.
@@ -183,7 +184,7 @@ abstract class ContentTranslationTestBase extends WebTestBase {
if (empty($this->fieldName)) {
$this->fieldName = 'field_test_et_ui_test';
}
- entity_create('field_storage_config', array(
+ FieldStorageConfig::create(array(
'field_name' => $this->fieldName,
'type' => 'string',
'entity_type' => $this->entityTypeId,
diff --git a/core/modules/datetime/src/Tests/DateTimeFieldTest.php b/core/modules/datetime/src/Tests/DateTimeFieldTest.php
index 14ad190..0aa39fc 100644
--- a/core/modules/datetime/src/Tests/DateTimeFieldTest.php
+++ b/core/modules/datetime/src/Tests/DateTimeFieldTest.php
@@ -12,6 +12,7 @@ use Drupal\Component\Utility\Unicode;
use Drupal\Core\Entity\Entity\EntityViewDisplay;
use Drupal\Core\Datetime\DrupalDateTime;
use Drupal\simpletest\WebTestBase;
+use Drupal\field\Entity\FieldStorageConfig;
/**
* Tests Datetime field functionality.
@@ -77,7 +78,7 @@ class DateTimeFieldTest extends WebTestBase {
// Create a field with settings to validate.
$field_name = Unicode::strtolower($this->randomMachineName());
- $this->fieldStorage = entity_create('field_storage_config', array(
+ $this->fieldStorage = FieldStorageConfig::create(array(
'field_name' => $field_name,
'entity_type' => 'entity_test',
'type' => 'datetime',
@@ -624,7 +625,7 @@ class DateTimeFieldTest extends WebTestBase {
// Create a field storage with settings to validate.
$field_name = Unicode::strtolower($this->randomMachineName());
- $field_storage = entity_create('field_storage_config', array(
+ $field_storage = FieldStorageConfig::create(array(
'field_name' => $field_name,
'entity_type' => 'node',
'type' => 'datetime',
diff --git a/core/modules/datetime/src/Tests/DateTimeItemTest.php b/core/modules/datetime/src/Tests/DateTimeItemTest.php
index d83d2a2..658e0fb 100644
--- a/core/modules/datetime/src/Tests/DateTimeItemTest.php
+++ b/core/modules/datetime/src/Tests/DateTimeItemTest.php
@@ -10,6 +10,7 @@ namespace Drupal\datetime\Tests;
use Drupal\Core\Field\FieldItemListInterface;
use Drupal\Core\Field\FieldItemInterface;
use Drupal\field\Tests\FieldUnitTestBase;
+use Drupal\field\Entity\FieldStorageConfig;
/**
* Tests the new entity API for the date field type.
@@ -29,7 +30,7 @@ class DateTimeItemTest extends FieldUnitTestBase {
parent::setUp();
// Create a field with settings to validate.
- $field_storage = entity_create('field_storage_config', array(
+ $field_storage = FieldStorageConfig::create(array(
'field_name' => 'field_datetime',
'type' => 'datetime',
'entity_type' => 'entity_test',
diff --git a/core/modules/datetime/src/Tests/Views/DateTimeHandlerTestBase.php b/core/modules/datetime/src/Tests/Views/DateTimeHandlerTestBase.php
index 068f718..b563f04 100644
--- a/core/modules/datetime/src/Tests/Views/DateTimeHandlerTestBase.php
+++ b/core/modules/datetime/src/Tests/Views/DateTimeHandlerTestBase.php
@@ -10,6 +10,7 @@ namespace Drupal\datetime\Tests\Views;
use Drupal\datetime\Plugin\Field\FieldType\DateTimeItem;
use Drupal\views\Tests\Handler\HandlerTestBase;
use Drupal\views\Tests\ViewTestData;
+use Drupal\field\Entity\FieldStorageConfig;
/**
* Base class for testing datetime handlers.
@@ -49,7 +50,7 @@ abstract class DateTimeHandlerTestBase extends HandlerTestBase {
'name' => 'page'
]);
$node_type->save();
- $fieldStorage = entity_create('field_storage_config', [
+ $fieldStorage = FieldStorageConfig::create([
'field_name' => static::$field_name,
'entity_type' => 'node',
'type' => 'datetime',
diff --git a/core/modules/field/src/Entity/FieldStorageConfig.php b/core/modules/field/src/Entity/FieldStorageConfig.php
index d4c2922..eaf14c6 100644
--- a/core/modules/field/src/Entity/FieldStorageConfig.php
+++ b/core/modules/field/src/Entity/FieldStorageConfig.php
@@ -15,6 +15,7 @@ use Drupal\Core\Field\FieldException;
use Drupal\Core\Field\FieldStorageDefinitionInterface;
use Drupal\Core\TypedData\OptionsProviderInterface;
use Drupal\field\FieldStorageConfigInterface;
+use Drupal\field\Entity\FieldStorageConfig;
/**
* Defines the Field storage configuration entity.
@@ -238,7 +239,7 @@ class FieldStorageConfig extends ConfigEntityBase implements FieldStorageConfigI
* - type: required.
*
* In most cases, Field entities are created via
- * entity_create('field_storage_config', $values)), where $values is the same
+ * FieldStorageConfig::create($values)), where $values is the same
* parameter as in this constructor.
*
* @see entity_create()
diff --git a/core/modules/field/src/Tests/Boolean/BooleanItemTest.php b/core/modules/field/src/Tests/Boolean/BooleanItemTest.php
index e9d7605..5647073 100644
--- a/core/modules/field/src/Tests/Boolean/BooleanItemTest.php
+++ b/core/modules/field/src/Tests/Boolean/BooleanItemTest.php
@@ -10,6 +10,7 @@ namespace Drupal\field\Tests\Boolean;
use Drupal\Core\Field\FieldItemListInterface;
use Drupal\Core\Field\FieldItemInterface;
use Drupal\field\Tests\FieldUnitTestBase;
+use Drupal\field\Entity\FieldStorageConfig;
/**
* Tests the new entity API for the boolean field type.
@@ -25,7 +26,7 @@ class BooleanItemTest extends FieldUnitTestBase {
parent::setUp();
// Create a boolean field and storage for validation.
- entity_create('field_storage_config', array(
+ FieldStorageConfig::create(array(
'field_name' => 'field_boolean',
'entity_type' => 'entity_test',
'type' => 'boolean',
diff --git a/core/modules/field/src/Tests/BulkDeleteTest.php b/core/modules/field/src/Tests/BulkDeleteTest.php
index d7e1aca..3a9f5b8 100644
--- a/core/modules/field/src/Tests/BulkDeleteTest.php
+++ b/core/modules/field/src/Tests/BulkDeleteTest.php
@@ -9,6 +9,7 @@ namespace Drupal\field\Tests;
use Drupal\Core\Entity\EntityInterface;
use Drupal\field\Entity\FieldConfig;
+use Drupal\field\Entity\FieldStorageConfig;
/**
* Bulk delete storages and fields, and clean up afterwards.
@@ -105,7 +106,7 @@ class BulkDeleteTest extends FieldUnitTestBase {
}
// Create two field storages.
- $field_storage = entity_create('field_storage_config', array(
+ $field_storage = FieldStorageConfig::create(array(
'field_name' => 'bf_1',
'entity_type' => $this->entityTypeId,
'type' => 'test_field',
@@ -113,7 +114,7 @@ class BulkDeleteTest extends FieldUnitTestBase {
));
$field_storage->save();
$this->fieldStorages[] = $field_storage;
- $field_storage = entity_create('field_storage_config', array(
+ $field_storage = FieldStorageConfig::create(array(
'field_name' => 'bf_2',
'entity_type' => $this->entityTypeId,
'type' => 'test_field',
diff --git a/core/modules/field/src/Tests/DisplayApiTest.php b/core/modules/field/src/Tests/DisplayApiTest.php
index 0ad584d..f06f782 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\FieldStorageConfig;
/**
* Tests the field display API.
@@ -94,7 +95,7 @@ class DisplayApiTest extends FieldUnitTestBase {
),
);
- entity_create('field_storage_config', $field_storage)->save();
+ FieldStorageConfig::create($field_storage)->save();
entity_create('field_config', $field)->save();
// Create a display for the default view mode.
entity_get_display($field['entity_type'], $field['bundle'], 'default')
diff --git a/core/modules/field/src/Tests/Email/EmailFieldTest.php b/core/modules/field/src/Tests/Email/EmailFieldTest.php
index b916ed0..1bbd0f6 100644
--- a/core/modules/field/src/Tests/Email/EmailFieldTest.php
+++ b/core/modules/field/src/Tests/Email/EmailFieldTest.php
@@ -9,6 +9,7 @@ namespace Drupal\field\Tests\Email;
use Drupal\Component\Utility\Unicode;
use Drupal\simpletest\WebTestBase;
+use Drupal\field\Entity\FieldStorageConfig;
/**
* Tests email field functionality.
@@ -54,7 +55,7 @@ class EmailFieldTest extends WebTestBase {
function testEmailField() {
// Create a field with settings to validate.
$field_name = Unicode::strtolower($this->randomMachineName());
- $this->fieldStorage = entity_create('field_storage_config', array(
+ $this->fieldStorage = FieldStorageConfig::create(array(
'field_name' => $field_name,
'entity_type' => 'entity_test',
'type' => 'email',
diff --git a/core/modules/field/src/Tests/Email/EmailItemTest.php b/core/modules/field/src/Tests/Email/EmailItemTest.php
index b6a148f..58c1e29 100644
--- a/core/modules/field/src/Tests/Email/EmailItemTest.php
+++ b/core/modules/field/src/Tests/Email/EmailItemTest.php
@@ -10,6 +10,7 @@ namespace Drupal\field\Tests\Email;
use Drupal\Core\Field\FieldItemListInterface;
use Drupal\Core\Field\FieldItemInterface;
use Drupal\field\Tests\FieldUnitTestBase;
+use Drupal\field\Entity\FieldStorageConfig;
/**
* Tests the new entity API for the email field type.
@@ -22,7 +23,7 @@ class EmailItemTest extends FieldUnitTestBase {
parent::setUp();
// Create an email field storage and field for validation.
- entity_create('field_storage_config', array(
+ FieldStorageConfig::create(array(
'field_name' => 'field_email',
'entity_type' => 'entity_test',
'type' => 'email',
diff --git a/core/modules/field/src/Tests/EntityReference/EntityReferenceAutoCreateTest.php b/core/modules/field/src/Tests/EntityReference/EntityReferenceAutoCreateTest.php
index 77bede9..9279dc0 100644
--- a/core/modules/field/src/Tests/EntityReference/EntityReferenceAutoCreateTest.php
+++ b/core/modules/field/src/Tests/EntityReference/EntityReferenceAutoCreateTest.php
@@ -10,6 +10,7 @@ namespace Drupal\field\Tests\EntityReference;
use Drupal\Core\Field\FieldStorageDefinitionInterface;
use Drupal\simpletest\WebTestBase;
use Drupal\node\Entity\Node;
+use Drupal\field\Entity\FieldStorageConfig;
/**
* Tests creating new entity (e.g. taxonomy-term) from an autocomplete widget.
@@ -44,7 +45,7 @@ class EntityReferenceAutoCreateTest extends WebTestBase {
$referenced = $this->drupalCreateContentType();
$this->referencedType = $referenced->id();
- entity_create('field_storage_config', array(
+ FieldStorageConfig::create(array(
'field_name' => 'test_field',
'entity_type' => 'node',
'translatable' => FALSE,
diff --git a/core/modules/field/src/Tests/EntityReference/EntityReferenceFieldDefaultValueTest.php b/core/modules/field/src/Tests/EntityReference/EntityReferenceFieldDefaultValueTest.php
index ae6fec7..473f9e0 100644
--- a/core/modules/field/src/Tests/EntityReference/EntityReferenceFieldDefaultValueTest.php
+++ b/core/modules/field/src/Tests/EntityReference/EntityReferenceFieldDefaultValueTest.php
@@ -55,7 +55,7 @@ class EntityReferenceFieldDefaultValueTest extends WebTestBase {
$referenced_node = $this->drupalCreateNode(array('type' => 'referenced_content'));
$field_name = Unicode::strtolower($this->randomMachineName());
- $field_storage = entity_create('field_storage_config', array(
+ $field_storage = FieldStorageConfig::create(array(
'field_name' => $field_name,
'entity_type' => 'node',
'type' => 'entity_reference',
@@ -118,7 +118,7 @@ class EntityReferenceFieldDefaultValueTest extends WebTestBase {
$referenced_node_type2 = $this->drupalCreateContentType(array('type' => 'referenced_config_to_preserve'));
$field_name = Unicode::strtolower($this->randomMachineName());
- $field_storage = entity_create('field_storage_config', array(
+ $field_storage = FieldStorageConfig::create(array(
'field_name' => $field_name,
'entity_type' => 'node',
'type' => 'entity_reference',
diff --git a/core/modules/field/src/Tests/EntityReference/EntityReferenceFieldTranslatedReferenceViewTest.php b/core/modules/field/src/Tests/EntityReference/EntityReferenceFieldTranslatedReferenceViewTest.php
index 7b3568c..bad3d98 100644
--- a/core/modules/field/src/Tests/EntityReference/EntityReferenceFieldTranslatedReferenceViewTest.php
+++ b/core/modules/field/src/Tests/EntityReference/EntityReferenceFieldTranslatedReferenceViewTest.php
@@ -10,6 +10,7 @@ namespace Drupal\field\Tests\EntityReference;
use Drupal\language\Entity\ConfigurableLanguage;
use Drupal\Core\Field\FieldStorageDefinitionInterface;
use Drupal\simpletest\WebTestBase;
+use Drupal\field\Entity\FieldStorageConfig;
/**
* Tests the translation of entity reference field display on nodes.
@@ -206,7 +207,7 @@ class EntityReferenceFieldTranslatedReferenceViewTest extends WebTestBase {
* Adds term reference field for the article content type.
*/
protected function setUpEntityReferenceField() {
- entity_create('field_storage_config', array(
+ FieldStorageConfig::create(array(
'field_name' => $this->referenceFieldName,
'entity_type' => $this->testEntityTypeName,
'type' => 'entity_reference',
diff --git a/core/modules/field/src/Tests/EntityReference/EntityReferenceFileUploadTest.php b/core/modules/field/src/Tests/EntityReference/EntityReferenceFileUploadTest.php
index eb9f640..922b865 100644
--- a/core/modules/field/src/Tests/EntityReference/EntityReferenceFileUploadTest.php
+++ b/core/modules/field/src/Tests/EntityReference/EntityReferenceFileUploadTest.php
@@ -9,6 +9,7 @@ namespace Drupal\field\Tests\EntityReference;
use Drupal\Core\Field\FieldStorageDefinitionInterface;
use Drupal\simpletest\WebTestBase;
+use Drupal\field\Entity\FieldStorageConfig;
/**
* Tests an autocomplete widget with file upload.
@@ -51,7 +52,7 @@ class EntityReferenceFileUploadTest extends WebTestBase {
$this->referencedType = $referenced->id();
$this->nodeId = $this->drupalCreateNode(array('type' => $referenced->id()))->id();
- entity_create('field_storage_config', array(
+ FieldStorageConfig::create(array(
'field_name' => 'test_field',
'entity_type' => 'node',
'translatable' => FALSE,
@@ -83,7 +84,7 @@ class EntityReferenceFileUploadTest extends WebTestBase {
// Create a file field.
$file_field_name = 'file_field';
- $field_storage = entity_create('field_storage_config', array(
+ $field_storage = FieldStorageConfig::create(array(
'field_name' => $file_field_name,
'entity_type' => 'node',
'type' => 'file'
diff --git a/core/modules/field/src/Tests/EntityReference/EntityReferenceFormatterTest.php b/core/modules/field/src/Tests/EntityReference/EntityReferenceFormatterTest.php
index 87da3ec..5654f70 100644
--- a/core/modules/field/src/Tests/EntityReference/EntityReferenceFormatterTest.php
+++ b/core/modules/field/src/Tests/EntityReference/EntityReferenceFormatterTest.php
@@ -82,7 +82,7 @@ class EntityReferenceFormatterTest extends EntityUnitTestBase {
// Set up a field, so that the entity that'll be referenced bubbles up a
// cache tag when rendering it entirely.
- entity_create('field_storage_config', array(
+ FieldStorageConfig::create(array(
'field_name' => 'body',
'entity_type' => $this->entityType,
'type' => 'text',
diff --git a/core/modules/field/src/Tests/EntityReference/Views/SelectionTest.php b/core/modules/field/src/Tests/EntityReference/Views/SelectionTest.php
index c5db78b..69986d8 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 @@ namespace Drupal\field\Tests\EntityReference\Views;
use Drupal\simpletest\WebTestBase;
use Drupal\views\Views;
+use Drupal\field\Entity\FieldStorageConfig;
/**
* Tests entity reference selection handler.
@@ -50,7 +51,7 @@ class SelectionTest extends WebTestBase {
}
// Create a field.
- $field_storage = entity_create('field_storage_config', array(
+ $field_storage = FieldStorageConfig::create(array(
'field_name' => 'test_field',
'entity_type' => 'entity_test',
'translatable' => FALSE,
diff --git a/core/modules/field/src/Tests/FieldAccessTest.php b/core/modules/field/src/Tests/FieldAccessTest.php
index 3617364..d00ce92 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\FieldStorageConfig;
+
/**
* Tests Field access.
*
@@ -50,7 +52,7 @@ class FieldAccessTest extends FieldTestBase {
'entity_type' => 'node',
'type' => 'text',
);
- entity_create('field_storage_config', $field_storage)->save();
+ FieldStorageConfig::create($field_storage)->save();
$field = array(
'field_name' => $field_storage['field_name'],
'entity_type' => 'node',
diff --git a/core/modules/field/src/Tests/FieldAttachStorageTest.php b/core/modules/field/src/Tests/FieldAttachStorageTest.php
index a7c7217..31c11d9 100644
--- a/core/modules/field/src/Tests/FieldAttachStorageTest.php
+++ b/core/modules/field/src/Tests/FieldAttachStorageTest.php
@@ -8,6 +8,7 @@
namespace Drupal\field\Tests;
use Drupal\Component\Utility\Unicode;
use Drupal\field\Entity\FieldConfig;
+use Drupal\field\Entity\FieldStorageConfig;
/**
* Tests storage-related Field Attach API functions.
@@ -95,7 +96,7 @@ class FieldAttachStorageTest extends FieldUnitTestBase {
);
for ($i = 1; $i <= 3; $i++) {
$field_names[$i] = 'field_' . $i;
- $field_storage = entity_create('field_storage_config', array(
+ $field_storage = FieldStorageConfig::create(array(
'field_name' => $field_names[$i],
'entity_type' => $entity_type,
'type' => 'test_field',
@@ -323,7 +324,7 @@ class FieldAttachStorageTest extends FieldUnitTestBase {
'type' => 'test_field',
'cardinality' => 1,
);
- entity_create('field_storage_config', $field_storage)->save();
+ FieldStorageConfig::create($field_storage)->save();
$field = array(
'field_name' => $field_name,
'entity_type' => $entity_type,
diff --git a/core/modules/field/src/Tests/FieldCrudTest.php b/core/modules/field/src/Tests/FieldCrudTest.php
index d6e9994..621f58e 100644
--- a/core/modules/field/src/Tests/FieldCrudTest.php
+++ b/core/modules/field/src/Tests/FieldCrudTest.php
@@ -50,7 +50,7 @@ class FieldCrudTest extends FieldUnitTestBase {
'entity_type' => 'entity_test',
'type' => 'test_field',
);
- $this->fieldStorage = entity_create('field_storage_config', $this->fieldStorageDefinition);
+ $this->fieldStorage = FieldStorageConfig::create($this->fieldStorageDefinition);
$this->fieldStorage->save();
$this->fieldDefinition = array(
'field_name' => $this->fieldStorage->getName(),
@@ -262,7 +262,7 @@ class FieldCrudTest extends FieldUnitTestBase {
$this->assertFalse(FieldConfig::loadByName('entity_test', $field_definition_2['bundle'], $field_storage->getName()));
// Check that deletion of the last field deletes the storage.
- $field_storage = entity_create('field_storage_config', $this->fieldStorageDefinition);
+ $field_storage = FieldStorageConfig::create($this->fieldStorageDefinition);
$field_storage->save();
$field = entity_create('field_config', $this->fieldDefinition);
$field->save();
@@ -275,7 +275,7 @@ class FieldCrudTest extends FieldUnitTestBase {
// Check that deletion of all fields using a storage simultaneously deletes
// the storage.
- $field_storage = entity_create('field_storage_config', $this->fieldStorageDefinition);
+ $field_storage = FieldStorageConfig::create($this->fieldStorageDefinition);
$field_storage->save();
$field = entity_create('field_config', $this->fieldDefinition);
$field->save();
diff --git a/core/modules/field/src/Tests/FieldDataCountTest.php b/core/modules/field/src/Tests/FieldDataCountTest.php
index bbb0cd9..76dc6a0 100644
--- a/core/modules/field/src/Tests/FieldDataCountTest.php
+++ b/core/modules/field/src/Tests/FieldDataCountTest.php
@@ -54,7 +54,7 @@ class FieldDataCountTest extends FieldUnitTestBase {
// Create a field with a cardinality of 2 to show that we are counting
// entities and not rows in a table.
/** @var \Drupal\field\Entity\FieldStorageConfig $field_storage */
- $field_storage = entity_create('field_storage_config', array(
+ $field_storage = FieldStorageConfig::create(array(
'field_name' => 'field_int',
'entity_type' => 'entity_test',
'type' => 'integer',
diff --git a/core/modules/field/src/Tests/FieldImportDeleteUninstallTest.php b/core/modules/field/src/Tests/FieldImportDeleteUninstallTest.php
index b5b2d157..04547a8 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\FieldStorageConfig;
+
/**
* Delete field storages and fields during config synchronization and uninstall
* module that provides the field type.
@@ -39,7 +41,7 @@ class FieldImportDeleteUninstallTest extends FieldUnitTestBase {
// Create a field to delete to prove that
// \Drupal\field\ConfigImporterFieldPurger does not purge fields that are
// not related to the configuration synchronization.
- $unrelated_field_storage = entity_create('field_storage_config', array(
+ $unrelated_field_storage = FieldStorageConfig::create(array(
'field_name' => 'field_int',
'entity_type' => 'entity_test',
'type' => 'integer',
@@ -51,7 +53,7 @@ class FieldImportDeleteUninstallTest extends FieldUnitTestBase {
))->save();
// Create a telephone field for validation.
- $field_storage = entity_create('field_storage_config', array(
+ $field_storage = FieldStorageConfig::create(array(
'field_name' => 'field_test',
'entity_type' => 'entity_test',
'type' => 'telephone',
@@ -113,7 +115,7 @@ class FieldImportDeleteUninstallTest extends FieldUnitTestBase {
*/
public function testImportAlreadyDeletedUninstall() {
// Create a telephone field for validation.
- $field_storage = entity_create('field_storage_config', array(
+ $field_storage = FieldStorageConfig::create(array(
'field_name' => 'field_test',
'entity_type' => 'entity_test',
'type' => 'telephone',
diff --git a/core/modules/field/src/Tests/FieldImportDeleteUninstallUiTest.php b/core/modules/field/src/Tests/FieldImportDeleteUninstallUiTest.php
index 58766e8..3d602ba 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\FieldStorageConfig;
+
/**
* Delete field storages and fields during config synchronization and uninstall
* module that provides the field type through the UI.
@@ -36,7 +38,7 @@ class FieldImportDeleteUninstallUiTest extends FieldTestBase {
*/
public function testImportDeleteUninstall() {
// Create a telephone field.
- $field_storage = entity_create('field_storage_config', array(
+ $field_storage = FieldStorageConfig::create(array(
'field_name' => 'field_tel',
'entity_type' => 'entity_test',
'type' => 'telephone',
@@ -48,7 +50,7 @@ class FieldImportDeleteUninstallUiTest extends FieldTestBase {
))->save();
// Create a text field.
- $date_field_storage = entity_create('field_storage_config', array(
+ $date_field_storage = FieldStorageConfig::create(array(
'field_name' => 'field_date',
'entity_type' => 'entity_test',
'type' => 'datetime',
diff --git a/core/modules/field/src/Tests/FieldStorageCrudTest.php b/core/modules/field/src/Tests/FieldStorageCrudTest.php
index 8912783..0def12c 100644
--- a/core/modules/field/src/Tests/FieldStorageCrudTest.php
+++ b/core/modules/field/src/Tests/FieldStorageCrudTest.php
@@ -42,7 +42,7 @@ class FieldStorageCrudTest extends FieldUnitTestBase {
'type' => 'test_field',
);
field_test_memorize();
- $field_storage = entity_create('field_storage_config', $field_storage_definition);
+ $field_storage = FieldStorageConfig::create($field_storage_definition);
$field_storage->save();
$field_storage = FieldStorageConfig::load($field_storage->id());
@@ -81,7 +81,7 @@ class FieldStorageCrudTest extends FieldUnitTestBase {
// Guarantee that the name is unique.
try {
- entity_create('field_storage_config', $field_storage_definition)->save();
+ FieldStorageConfig::create($field_storage_definition)->save();
$this->fail(t('Cannot create two fields with the same name.'));
}
catch (EntityStorageException $e) {
@@ -94,7 +94,7 @@ class FieldStorageCrudTest extends FieldUnitTestBase {
'field_name' => 'field_1',
'entity_type' => 'entity_type',
);
- entity_create('field_storage_config', $field_storage_definition)->save();
+ FieldStorageConfig::create($field_storage_definition)->save();
$this->fail(t('Cannot create a field with no type.'));
}
catch (FieldException $e) {
@@ -107,7 +107,7 @@ class FieldStorageCrudTest extends FieldUnitTestBase {
'type' => 'test_field',
'entity_type' => 'entity_test',
);
- entity_create('field_storage_config', $field_storage_definition)->save();
+ FieldStorageConfig::create($field_storage_definition)->save();
$this->fail(t('Cannot create an unnamed field.'));
}
catch (FieldException $e) {
@@ -119,7 +119,7 @@ class FieldStorageCrudTest extends FieldUnitTestBase {
'field_name' => 'test_field',
'type' => 'test_field'
);
- entity_create('field_storage_config', $field_storage_definition)->save();
+ FieldStorageConfig::create($field_storage_definition)->save();
$this->fail('Cannot create a field without an entity type.');
}
catch (FieldException $e) {
@@ -133,7 +133,7 @@ class FieldStorageCrudTest extends FieldUnitTestBase {
'entity_type' => 'entity_test',
'type' => 'test_field',
);
- entity_create('field_storage_config', $field_storage_definition)->save();
+ FieldStorageConfig::create($field_storage_definition)->save();
$this->fail(t('Cannot create a field with a name starting with a digit.'));
}
catch (FieldException $e) {
@@ -147,7 +147,7 @@ class FieldStorageCrudTest extends FieldUnitTestBase {
'entity_type' => 'entity_test',
'type' => 'test_field',
);
- entity_create('field_storage_config', $field_storage_definition)->save();
+ FieldStorageConfig::create($field_storage_definition)->save();
$this->fail(t('Cannot create a field with a name containing an illegal character.'));
}
catch (FieldException $e) {
@@ -161,7 +161,7 @@ class FieldStorageCrudTest extends FieldUnitTestBase {
'entity_type' => 'entity_test',
'type' => 'test_field',
);
- entity_create('field_storage_config', $field_storage_definition)->save();
+ FieldStorageConfig::create($field_storage_definition)->save();
$this->fail(t('Cannot create a field with a name longer than 32 characters.'));
}
catch (FieldException $e) {
@@ -176,7 +176,7 @@ class FieldStorageCrudTest extends FieldUnitTestBase {
'field_name' => 'id',
'entity_type' => 'entity_test',
);
- entity_create('field_storage_config', $field_storage_definition)->save();
+ FieldStorageConfig::create($field_storage_definition)->save();
$this->fail(t('Cannot create a field bearing the name of an entity key.'));
}
catch (FieldException $e) {
@@ -194,7 +194,7 @@ class FieldStorageCrudTest extends FieldUnitTestBase {
$schema = array(
'dummy' => 'foobar'
);
- $field_storage = entity_create('field_storage_config', array(
+ $field_storage = FieldStorageConfig::create(array(
'field_name' => 'field_2',
'entity_type' => 'entity_test',
'type' => 'test_field',
@@ -212,7 +212,7 @@ class FieldStorageCrudTest extends FieldUnitTestBase {
'entity_type' => 'entity_test',
'type' => 'test_field',
);
- $field_storage = entity_create('field_storage_config', $field_storage_definition);
+ $field_storage = FieldStorageConfig::create($field_storage_definition);
$field_storage->save();
$id = $field_storage->id();
@@ -240,7 +240,7 @@ class FieldStorageCrudTest extends FieldUnitTestBase {
*/
function testIndexes() {
// Check that indexes specified by the field type are used by default.
- $field_storage = entity_create('field_storage_config', array(
+ $field_storage = FieldStorageConfig::create(array(
'field_name' => 'field_1',
'entity_type' => 'entity_test',
'type' => 'test_field',
@@ -253,7 +253,7 @@ class FieldStorageCrudTest extends FieldUnitTestBase {
// Check that indexes specified by the field definition override the field
// type indexes.
- $field_storage = entity_create('field_storage_config', array(
+ $field_storage = FieldStorageConfig::create(array(
'field_name' => 'field_2',
'entity_type' => 'entity_test',
'type' => 'test_field',
@@ -269,7 +269,7 @@ class FieldStorageCrudTest extends FieldUnitTestBase {
// Check that indexes specified by the field definition add to the field
// type indexes.
- $field_storage = entity_create('field_storage_config', array(
+ $field_storage = FieldStorageConfig::create(array(
'field_name' => 'field_3',
'entity_type' => 'entity_test',
'type' => 'test_field',
@@ -297,13 +297,13 @@ class FieldStorageCrudTest extends FieldUnitTestBase {
'type' => 'test_field',
'entity_type' => 'entity_test',
);
- entity_create('field_storage_config', $field_storage_definition)->save();
+ FieldStorageConfig::create($field_storage_definition)->save();
$another_field_storage_definition = array(
'field_name' => 'field_2',
'type' => 'test_field',
'entity_type' => 'entity_test',
);
- entity_create('field_storage_config', $another_field_storage_definition)->save();
+ FieldStorageConfig::create($another_field_storage_definition)->save();
// Create fields for each.
$field_definition = array(
@@ -347,7 +347,7 @@ class FieldStorageCrudTest extends FieldUnitTestBase {
// 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();
+ FieldStorageConfig::create($field_storage_definition)->save();
entity_create('field_config', $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.');
@@ -368,7 +368,7 @@ class FieldStorageCrudTest extends FieldUnitTestBase {
}
function testUpdateFieldType() {
- $field_storage = entity_create('field_storage_config', array(
+ $field_storage = FieldStorageConfig::create(array(
'field_name' => 'field_type',
'entity_type' => 'entity_test',
'type' => 'decimal',
@@ -393,7 +393,7 @@ class FieldStorageCrudTest extends FieldUnitTestBase {
// respected. Since cardinality enforcement is consistent across database
// systems, it makes a good test case.
$cardinality = 4;
- $field_storage = entity_create('field_storage_config', array(
+ $field_storage = FieldStorageConfig::create(array(
'field_name' => 'field_update',
'entity_type' => 'entity_test',
'type' => 'test_field',
@@ -431,7 +431,7 @@ class FieldStorageCrudTest extends FieldUnitTestBase {
* Test field type modules forbidding an update.
*/
function testUpdateForbid() {
- $field_storage = entity_create('field_storage_config', array(
+ $field_storage = FieldStorageConfig::create(array(
'field_name' => 'forbidden',
'entity_type' => 'entity_test',
'type' => 'test_field',
diff --git a/core/modules/field/src/Tests/FieldUnitTestBase.php b/core/modules/field/src/Tests/FieldUnitTestBase.php
index ddcf3f9..c8a62c8 100644
--- a/core/modules/field/src/Tests/FieldUnitTestBase.php
+++ b/core/modules/field/src/Tests/FieldUnitTestBase.php
@@ -11,6 +11,7 @@ use Drupal\Component\Utility\Unicode;
use Drupal\Core\Entity\EntityInterface;
use Drupal\Core\Language\LanguageInterface;
use Drupal\simpletest\KernelTestBase;
+use Drupal\field\Entity\FieldStorageConfig;
/**
* Parent class for Field API unit tests.
@@ -91,7 +92,7 @@ abstract class FieldUnitTestBase extends KernelTestBase {
$field_definition = 'field_definition' . $suffix;
$this->fieldTestData->$field_name = Unicode::strtolower($this->randomMachineName() . '_field_name' . $suffix);
- $this->fieldTestData->$field_storage = entity_create('field_storage_config', array(
+ $this->fieldTestData->$field_storage = FieldStorageConfig::create(array(
'field_name' => $this->fieldTestData->$field_name,
'entity_type' => $entity_type,
'type' => 'test_field',
diff --git a/core/modules/field/src/Tests/FormTest.php b/core/modules/field/src/Tests/FormTest.php
index dbdc71a..c7d305b 100644
--- a/core/modules/field/src/Tests/FormTest.php
+++ b/core/modules/field/src/Tests/FormTest.php
@@ -99,7 +99,7 @@ class FormTest extends FieldTestBase {
$field_storage = $this->fieldStorageSingle;
$field_name = $field_storage['field_name'];
$this->field['field_name'] = $field_name;
- entity_create('field_storage_config', $field_storage)->save();
+ FieldStorageConfig::create($field_storage)->save();
entity_create('field_config', $this->field)->save();
entity_get_form_display($this->field['entity_type'], $this->field['bundle'], 'default')
->setComponent($field_name)
@@ -175,7 +175,7 @@ class FormTest extends FieldTestBase {
$this->field['field_name'] = $field_name;
$default = rand(1, 127);
$this->field['default_value'] = array(array('value' => $default));
- entity_create('field_storage_config', $field_storage)->save();
+ FieldStorageConfig::create($field_storage)->save();
entity_create('field_config', $this->field)->save();
entity_get_form_display($this->field['entity_type'], $this->field['bundle'], 'default')
->setComponent($field_name)
@@ -203,7 +203,7 @@ class FormTest extends FieldTestBase {
$field_name = $field_storage['field_name'];
$this->field['field_name'] = $field_name;
$this->field['required'] = TRUE;
- entity_create('field_storage_config', $field_storage)->save();
+ FieldStorageConfig::create($field_storage)->save();
entity_create('field_config', $this->field)->save();
entity_get_form_display($this->field['entity_type'], $this->field['bundle'], 'default')
->setComponent($field_name)
@@ -239,7 +239,7 @@ class FormTest extends FieldTestBase {
// $this->field = $this->field_multiple;
// $field_name = $this->field['field_name'];
// $this->instance['field_name'] = $field_name;
-// entity_create('field_storage_config', $this->field)->save();
+// FieldStorageConfig::create($this->field)->save();
// entity_create('field_config', $this->instance)->save();
// }
@@ -247,7 +247,7 @@ class FormTest extends FieldTestBase {
$field_storage = $this->fieldStorageUnlimited;
$field_name = $field_storage['field_name'];
$this->field['field_name'] = $field_name;
- entity_create('field_storage_config', $field_storage)->save();
+ FieldStorageConfig::create($field_storage)->save();
entity_create('field_config', $this->field)->save();
entity_get_form_display($this->field['entity_type'], $this->field['bundle'], 'default')
->setComponent($field_name)
@@ -358,14 +358,14 @@ class FormTest extends FieldTestBase {
$field_storage = $this->fieldStorageUnlimited;
$field_name = $field_storage['field_name'];
$this->field['field_name'] = $field_name;
- entity_create('field_storage_config', $field_storage)->save();
+ FieldStorageConfig::create($field_storage)->save();
entity_create('field_config', $this->field)->save();
entity_get_form_display($this->field['entity_type'], $this->field['bundle'], 'default')
->setComponent($field_name)
->save();
// Add a required radio field.
- entity_create('field_storage_config', array(
+ FieldStorageConfig::create(array(
'field_name' => 'required_radio_test',
'entity_type' => 'entity_test',
'type' => 'list_string',
@@ -405,7 +405,7 @@ class FormTest extends FieldTestBase {
$field_storage = $this->fieldStorageUnlimited;
$field_name = $field_storage['field_name'];
$this->field['field_name'] = $field_name;
- entity_create('field_storage_config', $field_storage)->save();
+ FieldStorageConfig::create($field_storage)->save();
entity_create('field_config', $this->field)->save();
entity_get_form_display($this->field['entity_type'], $this->field['bundle'], 'default')
->setComponent($field_name)
@@ -466,7 +466,7 @@ class FormTest extends FieldTestBase {
$field_storage = $this->fieldStorageMultiple;
$field_name = $field_storage['field_name'];
$this->field['field_name'] = $field_name;
- entity_create('field_storage_config', $field_storage)->save();
+ FieldStorageConfig::create($field_storage)->save();
entity_create('field_config', $this->field)->save();
entity_get_form_display($this->field['entity_type'], $this->field['bundle'], 'default')
->setComponent($field_name, array(
@@ -515,7 +515,7 @@ class FormTest extends FieldTestBase {
$field['field_name'] = $field_name;
$field['entity_type'] = $entity_type;
$field['bundle'] = $entity_type;
- entity_create('field_storage_config', $field_storage)->save();
+ FieldStorageConfig::create($field_storage)->save();
entity_create('field_config', $field)->save();
entity_get_form_display($entity_type, $entity_type, 'default')
->setComponent($field_name)
@@ -535,7 +535,7 @@ class FormTest extends FieldTestBase {
'bundle' => $entity_type,
'default_value' => array(0 => array('value' => 99)),
);
- entity_create('field_storage_config', $field_storage_no_access)->save();
+ FieldStorageConfig::create($field_storage_no_access)->save();
entity_create('field_config', $field_no_access)->save();
entity_get_form_display($field_no_access['entity_type'], $field_no_access['bundle'], 'default')
->setComponent($field_name_no_access)
@@ -600,7 +600,7 @@ class FormTest extends FieldTestBase {
$this->field['default_value'] = array(0 => array('value' => 99));
$this->field['entity_type'] = $entity_type;
$this->field['bundle'] = $entity_type;
- entity_create('field_storage_config', $field_storage)->save();
+ FieldStorageConfig::create($field_storage)->save();
$this->field = entity_create('field_config', $this->field);
$this->field->save();
// We explicitly do not assign a widget in a form display, so the field
diff --git a/core/modules/field/src/Tests/NestedFormTest.php b/core/modules/field/src/Tests/NestedFormTest.php
index 5067b97..cc21fab 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\FieldStorageConfig;
/**
* Tests field elements in nested forms.
@@ -57,8 +58,8 @@ class NestedFormTest extends FieldTestBase {
*/
function testNestedFieldForm() {
// Add two fields on the 'entity_test'
- entity_create('field_storage_config', $this->fieldStorageSingle)->save();
- entity_create('field_storage_config', $this->fieldStorageUnlimited)->save();
+ FieldStorageConfig::create($this->fieldStorageSingle)->save();
+ FieldStorageConfig::create($this->fieldStorageUnlimited)->save();
$this->field['field_name'] = 'field_single';
$this->field['label'] = 'Single field';
entity_create('field_config', $this->field)->save();
diff --git a/core/modules/field/src/Tests/Number/NumberFieldTest.php b/core/modules/field/src/Tests/Number/NumberFieldTest.php
index 9537170..1e75068 100644
--- a/core/modules/field/src/Tests/Number/NumberFieldTest.php
+++ b/core/modules/field/src/Tests/Number/NumberFieldTest.php
@@ -9,6 +9,7 @@ namespace Drupal\field\Tests\Number;
use Drupal\Component\Utility\Unicode;
use Drupal\simpletest\WebTestBase;
+use Drupal\field\Entity\FieldStorageConfig;
/**
* Tests the creation of numeric fields.
@@ -43,7 +44,7 @@ class NumberFieldTest extends WebTestBase {
function testNumberDecimalField() {
// Create a field with settings to validate.
$field_name = Unicode::strtolower($this->randomMachineName());
- entity_create('field_storage_config', array(
+ FieldStorageConfig::create(array(
'field_name' => $field_name,
'entity_type' => 'entity_test',
'type' => 'decimal',
@@ -133,7 +134,7 @@ class NumberFieldTest extends WebTestBase {
// Create a field with settings to validate.
$field_name = Unicode::strtolower($this->randomMachineName());
- $storage = entity_create('field_storage_config', array(
+ $storage = FieldStorageConfig::create(array(
'field_name' => $field_name,
'entity_type' => 'entity_test',
'type' => 'integer',
@@ -276,7 +277,7 @@ class NumberFieldTest extends WebTestBase {
function testNumberFloatField() {
// Create a field with settings to validate.
$field_name = Unicode::strtolower($this->randomMachineName());
- entity_create('field_storage_config', array(
+ FieldStorageConfig::create(array(
'field_name' => $field_name,
'entity_type' => 'entity_test',
'type' => 'float',
@@ -377,13 +378,13 @@ class NumberFieldTest extends WebTestBase {
// Create a content type containing float and integer fields.
$this->drupalCreateContentType(array('type' => $type));
- entity_create('field_storage_config', array(
+ FieldStorageConfig::create(array(
'field_name' => $float_field,
'entity_type' => 'node',
'type' => 'float',
))->save();
- entity_create('field_storage_config', array(
+ FieldStorageConfig::create(array(
'field_name' => $integer_field,
'entity_type' => 'node',
'type' => 'integer',
@@ -501,7 +502,7 @@ class NumberFieldTest extends WebTestBase {
function testCreateNumberFloatField() {
// Create a float field.
$field_name = Unicode::strtolower($this->randomMachineName());
- entity_create('field_storage_config', array(
+ FieldStorageConfig::create(array(
'field_name' => $field_name,
'entity_type' => 'entity_test',
'type' => 'float',
@@ -526,7 +527,7 @@ class NumberFieldTest extends WebTestBase {
function testCreateNumberDecimalField() {
// Create a decimal field.
$field_name = Unicode::strtolower($this->randomMachineName());
- entity_create('field_storage_config', array(
+ FieldStorageConfig::create(array(
'field_name' => $field_name,
'entity_type' => 'entity_test',
'type' => 'decimal',
diff --git a/core/modules/field/src/Tests/Number/NumberItemTest.php b/core/modules/field/src/Tests/Number/NumberItemTest.php
index e7eac30..0e80428 100644
--- a/core/modules/field/src/Tests/Number/NumberItemTest.php
+++ b/core/modules/field/src/Tests/Number/NumberItemTest.php
@@ -10,6 +10,7 @@ namespace Drupal\field\Tests\Number;
use Drupal\Core\Field\FieldItemInterface;
use Drupal\Core\Field\FieldItemListInterface;
use Drupal\field\Tests\FieldUnitTestBase;
+use Drupal\field\Entity\FieldStorageConfig;
/**
* Tests the new entity API for the number field type.
@@ -30,7 +31,7 @@ class NumberItemTest extends FieldUnitTestBase {
// Create number field storages and fields for validation.
foreach (array('integer', 'float', 'decimal') as $type) {
- entity_create('field_storage_config', array(
+ FieldStorageConfig::create(array(
'entity_type' => 'entity_test',
'field_name' => 'field_' . $type,
'type' => $type,
diff --git a/core/modules/field/src/Tests/ShapeItemTest.php b/core/modules/field/src/Tests/ShapeItemTest.php
index 9f7df3b..0e20aab 100644
--- a/core/modules/field/src/Tests/ShapeItemTest.php
+++ b/core/modules/field/src/Tests/ShapeItemTest.php
@@ -9,6 +9,7 @@ namespace Drupal\field\Tests;
use Drupal\Core\Field\FieldItemInterface;
use Drupal\Core\Field\FieldItemListInterface;
+use Drupal\field\Entity\FieldStorageConfig;
/**
* Tests the new entity API for the shape field type.
@@ -35,7 +36,7 @@ class ShapeItemTest extends FieldUnitTestBase {
parent::setUp();
// Create a 'shape' field and storage for validation.
- entity_create('field_storage_config', array(
+ FieldStorageConfig::create(array(
'field_name' => $this->fieldName,
'entity_type' => 'entity_test',
'type' => 'shape',
diff --git a/core/modules/field/src/Tests/String/StringFieldTest.php b/core/modules/field/src/Tests/String/StringFieldTest.php
index 3114490..cb8e26a 100644
--- a/core/modules/field/src/Tests/String/StringFieldTest.php
+++ b/core/modules/field/src/Tests/String/StringFieldTest.php
@@ -9,6 +9,7 @@ namespace Drupal\field\Tests\String;
use Drupal\Component\Utility\Unicode;
use Drupal\simpletest\WebTestBase;
+use Drupal\field\Entity\FieldStorageConfig;
/**
* Tests the creation of string fields.
@@ -54,7 +55,7 @@ class StringFieldTest extends WebTestBase {
function _testTextfieldWidgets($field_type, $widget_type) {
// Create a field.
$field_name = Unicode::strtolower($this->randomMachineName());
- $field_storage = entity_create('field_storage_config', array(
+ $field_storage = FieldStorageConfig::create(array(
'field_name' => $field_name,
'entity_type' => 'entity_test',
'type' => $field_type
diff --git a/core/modules/field/src/Tests/TestItemTest.php b/core/modules/field/src/Tests/TestItemTest.php
index 7aa4679..3743967 100644
--- a/core/modules/field/src/Tests/TestItemTest.php
+++ b/core/modules/field/src/Tests/TestItemTest.php
@@ -10,6 +10,7 @@ namespace Drupal\field\Tests;
use Drupal\Core\Field\BaseFieldDefinition;
use Drupal\Core\Field\FieldItemInterface;
use Drupal\Core\Field\FieldItemListInterface;
+use Drupal\field\Entity\FieldStorageConfig;
/**
* Tests the new entity API for the test field type.
@@ -36,7 +37,7 @@ class TestItemTest extends FieldUnitTestBase {
parent::setUp();
// Create a 'test_field' field and storage for validation.
- entity_create('field_storage_config', array(
+ FieldStorageConfig::create(array(
'field_name' => $this->fieldName,
'entity_type' => 'entity_test',
'type' => 'test_field',
diff --git a/core/modules/field/src/Tests/TestItemWithDependenciesTest.php b/core/modules/field/src/Tests/TestItemWithDependenciesTest.php
index a3be92b..48adb75 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\FieldStorageConfig;
+
/**
* Tests the new entity API for the test field with dependencies type.
*
@@ -33,7 +35,7 @@ class TestItemWithDependenciesTest extends FieldUnitTestBase {
*/
public function testTestItemWithDepenencies() {
// Create a 'test_field_with_dependencies' field and storage for validation.
- entity_create('field_storage_config', array(
+ FieldStorageConfig::create(array(
'field_name' => $this->fieldName,
'entity_type' => 'entity_test',
'type' => 'test_field_with_dependencies',
diff --git a/core/modules/field/src/Tests/TranslationTest.php b/core/modules/field/src/Tests/TranslationTest.php
index 8328951..9f3d698 100644
--- a/core/modules/field/src/Tests/TranslationTest.php
+++ b/core/modules/field/src/Tests/TranslationTest.php
@@ -9,6 +9,7 @@ namespace Drupal\field\Tests;
use Drupal\Component\Utility\Unicode;
use Drupal\language\Entity\ConfigurableLanguage;
+use Drupal\field\Entity\FieldStorageConfig;
/**
* Tests multilanguage fields logic.
@@ -88,7 +89,7 @@ class TranslationTest extends FieldUnitTestBase {
'type' => 'test_field',
'cardinality' => 4,
);
- $this->fieldStorage = entity_create('field_storage_config', $this->fieldStorageDefinition);
+ $this->fieldStorage = FieldStorageConfig::create($this->fieldStorageDefinition);
$this->fieldStorage->save();
$this->fieldDefinition = array(
@@ -144,7 +145,7 @@ class TranslationTest extends FieldUnitTestBase {
$field_name_default = Unicode::strtolower($this->randomMachineName() . '_field_name');
$field_storage_definition = $this->fieldStorageDefinition;
$field_storage_definition['field_name'] = $field_name_default;
- $field_storage = entity_create('field_storage_config', $field_storage_definition);
+ $field_storage = FieldStorageConfig::create($field_storage_definition);
$field_storage->save();
$field_definition = $this->fieldDefinition;
diff --git a/core/modules/field/src/Tests/TranslationWebTest.php b/core/modules/field/src/Tests/TranslationWebTest.php
index 8350285..a24dda1 100644
--- a/core/modules/field/src/Tests/TranslationWebTest.php
+++ b/core/modules/field/src/Tests/TranslationWebTest.php
@@ -65,7 +65,7 @@ class TranslationWebTest extends FieldTestBase {
'type' => 'test_field',
'cardinality' => 4,
);
- entity_create('field_storage_config', $field_storage)->save();
+ FieldStorageConfig::create($field_storage)->save();
$this->fieldStorage = FieldStorageConfig::load($this->entityTypeId . '.' . $this->fieldName);
$field = array(
diff --git a/core/modules/field/src/Tests/Views/FieldTestBase.php b/core/modules/field/src/Tests/Views/FieldTestBase.php
index 0425c29..9019f03 100644
--- a/core/modules/field/src/Tests/Views/FieldTestBase.php
+++ b/core/modules/field/src/Tests/Views/FieldTestBase.php
@@ -21,6 +21,7 @@ namespace Drupal\field\Tests\Views;
use Drupal\views\Tests\ViewTestBase;
use Drupal\views\Tests\ViewTestData;
+use Drupal\field\Entity\FieldStorageConfig;
/**
* Provides some helper methods for testing fieldapi integration into views.
@@ -66,7 +67,7 @@ abstract class FieldTestBase extends ViewTestBase {
$field_names = array();
for ($i = 0; $i < $amount; $i++) {
$field_names[$i] = 'field_name_' . $i;
- $this->fieldStorages[$i] = entity_create('field_storage_config', array(
+ $this->fieldStorages[$i] = FieldStorageConfig::create(array(
'field_name' => $field_names[$i],
'entity_type' => 'node',
'type' => $type,
diff --git a/core/modules/field/src/Tests/Views/HandlerFieldFieldTest.php b/core/modules/field/src/Tests/Views/HandlerFieldFieldTest.php
index f3be429..5524843 100644
--- a/core/modules/field/src/Tests/Views/HandlerFieldFieldTest.php
+++ b/core/modules/field/src/Tests/Views/HandlerFieldFieldTest.php
@@ -10,6 +10,7 @@ namespace Drupal\field\Tests\Views;
use Drupal\Core\Field\FieldStorageDefinitionInterface;
use Drupal\views\ViewExecutable;
use Drupal\views\Views;
+use Drupal\field\Entity\FieldStorageConfig;
/**
* Tests the field itself of the Field integration.
@@ -52,7 +53,7 @@ class HandlerFieldFieldTest extends FieldTestBase {
$this->setUpFieldStorages(3);
// Setup a field with cardinality > 1.
- $this->fieldStorages[3] = entity_create('field_storage_config', array(
+ $this->fieldStorages[3] = FieldStorageConfig::create(array(
'field_name' => 'field_name_3',
'entity_type' => 'node',
'type' => 'string',
@@ -60,7 +61,7 @@ class HandlerFieldFieldTest extends FieldTestBase {
));
$this->fieldStorages[3]->save();
// Setup a field that will have no value.
- $this->fieldStorages[4] = entity_create('field_storage_config', array(
+ $this->fieldStorages[4] = FieldStorageConfig::create(array(
'field_name' => 'field_name_4',
'entity_type' => 'node',
'type' => 'string',
@@ -69,7 +70,7 @@ class HandlerFieldFieldTest extends FieldTestBase {
$this->fieldStorages[4]->save();
// Setup a text field.
- $this->fieldStorages[5] = entity_create('field_storage_config', array(
+ $this->fieldStorages[5] = FieldStorageConfig::create(array(
'field_name' => 'field_name_5',
'entity_type' => 'node',
'type' => 'text',
@@ -78,7 +79,7 @@ class HandlerFieldFieldTest extends FieldTestBase {
// Setup a text field with access control.
// @see field_test_entity_field_access()
- $this->fieldStorages[6] = entity_create('field_storage_config', array(
+ $this->fieldStorages[6] = FieldStorageConfig::create(array(
'field_name' => 'field_no_view_access',
'entity_type' => 'node',
'type' => 'text',
diff --git a/core/modules/field/src/Tests/reEnableModuleFieldTest.php b/core/modules/field/src/Tests/reEnableModuleFieldTest.php
index b339618..9046350 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\FieldStorageConfig;
/**
* Tests the behavior of a field module after being disabled and re-enabled.
@@ -47,7 +48,7 @@ class reEnableModuleFieldTest extends WebTestBase {
function testReEnabledField() {
// Add a telephone field to the article content type.
- $field_storage = entity_create('field_storage_config', array(
+ $field_storage = FieldStorageConfig::create(array(
'field_name' => 'field_telephone',
'entity_type' => 'node',
'type' => 'telephone',
diff --git a/core/modules/field/tests/modules/field_test/field_test.module b/core/modules/field/tests/modules/field_test/field_test.module
index c86a7b9..058380a 100644
--- a/core/modules/field/tests/modules/field_test/field_test.module
+++ b/core/modules/field/tests/modules/field_test/field_test.module
@@ -2,6 +2,7 @@
use Drupal\field\FieldStorageConfigInterface;
use Drupal\Core\Form\FormStateInterface;
+use Drupal\field\Entity\FieldStorageConfig;
/**
* @file
@@ -42,7 +43,7 @@ require_once __DIR__ . '/field_test.field.inc';
* field_test_memorize();
*
* // call some Field API functions that invoke field_test hooks
- * entity_create('field_storage_config', $field_definition)->save();
+ * FieldStorageConfig::create($field_definition)->save();
*
* // retrieve and reset the memorized hook call data
* $mem = field_test_memorize();
diff --git a/core/modules/file/src/Tests/FileFieldTestBase.php b/core/modules/file/src/Tests/FileFieldTestBase.php
index 5874cf5..ae1507c 100644
--- a/core/modules/file/src/Tests/FileFieldTestBase.php
+++ b/core/modules/file/src/Tests/FileFieldTestBase.php
@@ -77,7 +77,7 @@ abstract class FileFieldTestBase extends WebTestBase {
* A list of widget settings that will be added to the widget defaults.
*/
function createFileField($name, $entity_type, $bundle, $storage_settings = array(), $field_settings = array(), $widget_settings = array()) {
- $field_storage = entity_create('field_storage_config', array(
+ $field_storage = FieldStorageConfig::create(array(
'entity_type' => $entity_type,
'field_name' => $name,
'type' => 'file',
diff --git a/core/modules/file/src/Tests/FileItemTest.php b/core/modules/file/src/Tests/FileItemTest.php
index 9337ca0..2279fa2 100644
--- a/core/modules/file/src/Tests/FileItemTest.php
+++ b/core/modules/file/src/Tests/FileItemTest.php
@@ -12,6 +12,7 @@ use Drupal\Core\Field\FieldItemListInterface;
use Drupal\Core\Field\FieldStorageDefinitionInterface;
use Drupal\field\Entity\FieldConfig;
use Drupal\field\Tests\FieldUnitTestBase;
+use Drupal\field\Entity\FieldStorageConfig;
/**
* Tests using entity fields of the file field type.
@@ -47,7 +48,7 @@ class FileItemTest extends FieldUnitTestBase {
$this->installEntitySchema('file');
$this->installSchema('file', array('file_usage'));
- entity_create('field_storage_config', array(
+ FieldStorageConfig::create(array(
'field_name' => 'file_test',
'entity_type' => 'entity_test',
'type' => 'file',
diff --git a/core/modules/file/src/Tests/Views/RelationshipUserFileDataTest.php b/core/modules/file/src/Tests/Views/RelationshipUserFileDataTest.php
index 8cdc903..0045f59 100644
--- a/core/modules/file/src/Tests/Views/RelationshipUserFileDataTest.php
+++ b/core/modules/file/src/Tests/Views/RelationshipUserFileDataTest.php
@@ -10,6 +10,7 @@ namespace Drupal\file\Tests\Views;
use Drupal\views\Tests\ViewTestBase;
use Drupal\views\Views;
use Drupal\views\Tests\ViewTestData;
+use Drupal\field\Entity\FieldStorageConfig;
/**
* Tests file on user relationship handler.
@@ -36,7 +37,7 @@ class RelationshipUserFileDataTest extends ViewTestBase {
parent::setUp();
// Create the user profile field and instance.
- entity_create('field_storage_config', array(
+ FieldStorageConfig::create(array(
'entity_type' => 'user',
'field_name' => 'user_file',
'type' => 'file',
diff --git a/core/modules/hal/src/Tests/NormalizerTestBase.php b/core/modules/hal/src/Tests/NormalizerTestBase.php
index 104a5e2..7aed3cf 100644
--- a/core/modules/hal/src/Tests/NormalizerTestBase.php
+++ b/core/modules/hal/src/Tests/NormalizerTestBase.php
@@ -22,6 +22,7 @@ use Drupal\serialization\EntityResolver\TargetIdResolver;
use Drupal\serialization\EntityResolver\UuidResolver;
use Drupal\simpletest\KernelTestBase;
use Symfony\Component\Serializer\Serializer;
+use Drupal\field\Entity\FieldStorageConfig;
/**
* Test the HAL normalizer.
@@ -93,7 +94,7 @@ abstract class NormalizerTestBase extends KernelTestBase {
))->save();
// Create the test text field.
- entity_create('field_storage_config', array(
+ FieldStorageConfig::create(array(
'field_name' => 'field_test_text',
'entity_type' => 'entity_test',
'type' => 'text',
@@ -106,7 +107,7 @@ abstract class NormalizerTestBase extends KernelTestBase {
))->save();
// Create the test translatable field.
- entity_create('field_storage_config', array(
+ FieldStorageConfig::create(array(
'field_name' => 'field_test_translatable_text',
'entity_type' => 'entity_test',
'type' => 'text',
@@ -119,7 +120,7 @@ abstract class NormalizerTestBase extends KernelTestBase {
))->save();
// Create the test entity reference field.
- entity_create('field_storage_config', array(
+ FieldStorageConfig::create(array(
'field_name' => 'field_test_entity_reference',
'entity_type' => 'entity_test',
'type' => 'entity_reference',
diff --git a/core/modules/image/src/Tests/ImageFieldDefaultImagesTest.php b/core/modules/image/src/Tests/ImageFieldDefaultImagesTest.php
index ee47e30..30a22fe 100644
--- a/core/modules/image/src/Tests/ImageFieldDefaultImagesTest.php
+++ b/core/modules/image/src/Tests/ImageFieldDefaultImagesTest.php
@@ -9,6 +9,7 @@ namespace Drupal\image\Tests;
use Drupal\Component\Utility\Unicode;
use Drupal\Core\Entity\Entity\EntityViewDisplay;
use Drupal\file\Entity\File;
+use Drupal\field\Entity\FieldStorageConfig;
/**
* Tests setting up default images both to the field and field field.
@@ -319,7 +320,7 @@ class ImageFieldDefaultImagesTest extends ImageFieldTestBase {
* Tests image field and field having an invalid default image.
*/
public function testInvalidDefaultImage() {
- $field_storage = entity_create('field_storage_config', array(
+ $field_storage = FieldStorageConfig::create(array(
'field_name' => Unicode::strtolower($this->randomMachineName()),
'entity_type' => 'node',
'type' => 'image',
diff --git a/core/modules/image/src/Tests/ImageFieldTestBase.php b/core/modules/image/src/Tests/ImageFieldTestBase.php
index 9984a76..2b645dd 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\FieldStorageConfig;
/**
* TODO: Test the following functions.
@@ -71,7 +72,7 @@ abstract class ImageFieldTestBase extends WebTestBase {
* Formatter settings to be added to the formatter defaults.
*/
function createImageField($name, $type_name, $storage_settings = array(), $field_settings = array(), $widget_settings = array(), $formatter_settings = array()) {
- entity_create('field_storage_config', array(
+ FieldStorageConfig::create(array(
'field_name' => $name,
'entity_type' => 'node',
'type' => 'image',
diff --git a/core/modules/image/src/Tests/ImageItemTest.php b/core/modules/image/src/Tests/ImageItemTest.php
index fddbd3f..c5ee594 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\FieldItemInterface;
use Drupal\Core\Field\FieldItemListInterface;
use Drupal\Core\Field\FieldStorageDefinitionInterface;
use Drupal\field\Tests\FieldUnitTestBase;
+use Drupal\field\Entity\FieldStorageConfig;
/**
* Tests using entity fields of the image field type.
@@ -44,7 +45,7 @@ class ImageItemTest extends FieldUnitTestBase {
$this->installEntitySchema('file');
$this->installSchema('file', array('file_usage'));
- entity_create('field_storage_config', array(
+ FieldStorageConfig::create(array(
'entity_type' => 'entity_test',
'field_name' => 'image_test',
'type' => 'image',
diff --git a/core/modules/image/src/Tests/ImageThemeFunctionTest.php b/core/modules/image/src/Tests/ImageThemeFunctionTest.php
index 44f649e..d64899b 100644
--- a/core/modules/image/src/Tests/ImageThemeFunctionTest.php
+++ b/core/modules/image/src/Tests/ImageThemeFunctionTest.php
@@ -11,6 +11,7 @@ use Drupal\Core\Field\FieldStorageDefinitionInterface;
use Drupal\Core\Url;
use Drupal\image\Entity\ImageStyle;
use Drupal\simpletest\WebTestBase;
+use Drupal\field\Entity\FieldStorageConfig;
/**
* Tests image theme functions.
@@ -41,7 +42,7 @@ class ImageThemeFunctionTest extends WebTestBase {
protected function setUp() {
parent::setUp();
- entity_create('field_storage_config', array(
+ FieldStorageConfig::create(array(
'entity_type' => 'entity_test',
'field_name' => 'image_test',
'type' => 'image',
diff --git a/core/modules/image/src/Tests/Views/RelationshipUserImageDataTest.php b/core/modules/image/src/Tests/Views/RelationshipUserImageDataTest.php
index 4ef0626..3df5e1f 100644
--- a/core/modules/image/src/Tests/Views/RelationshipUserImageDataTest.php
+++ b/core/modules/image/src/Tests/Views/RelationshipUserImageDataTest.php
@@ -10,6 +10,7 @@ namespace Drupal\image\Tests\Views;
use Drupal\views\Tests\ViewTestBase;
use Drupal\views\Views;
use Drupal\views\Tests\ViewTestData;
+use Drupal\field\Entity\FieldStorageConfig;
/**
* Tests image on user relationship handler.
@@ -36,7 +37,7 @@ class RelationshipUserImageDataTest extends ViewTestBase {
parent::setUp();
// Create the user profile field and instance.
- entity_create('field_storage_config', array(
+ FieldStorageConfig::create(array(
'entity_type' => 'user',
'field_name' => 'user_picture',
'type' => 'image',
diff --git a/core/modules/link/src/Tests/LinkFieldTest.php b/core/modules/link/src/Tests/LinkFieldTest.php
index 79c2cbb..c225686 100644
--- a/core/modules/link/src/Tests/LinkFieldTest.php
+++ b/core/modules/link/src/Tests/LinkFieldTest.php
@@ -12,6 +12,7 @@ use Drupal\Component\Utility\Unicode;
use Drupal\Core\Url;
use Drupal\link\LinkItemInterface;
use Drupal\simpletest\WebTestBase;
+use Drupal\field\Entity\FieldStorageConfig;
/**
* Tests link field widgets and formatters.
@@ -57,7 +58,7 @@ class LinkFieldTest extends WebTestBase {
function testURLValidation() {
$field_name = Unicode::strtolower($this->randomMachineName());
// Create a field with settings to validate.
- $this->fieldStorage = entity_create('field_storage_config', array(
+ $this->fieldStorage = FieldStorageConfig::create(array(
'field_name' => $field_name,
'entity_type' => 'entity_test',
'type' => 'link',
@@ -222,7 +223,7 @@ class LinkFieldTest extends WebTestBase {
function testLinkTitle() {
$field_name = Unicode::strtolower($this->randomMachineName());
// Create a field with settings to validate.
- $this->fieldStorage = entity_create('field_storage_config', array(
+ $this->fieldStorage = FieldStorageConfig::create(array(
'field_name' => $field_name,
'entity_type' => 'entity_test',
'type' => 'link',
@@ -336,7 +337,7 @@ class LinkFieldTest extends WebTestBase {
function testLinkFormatter() {
$field_name = Unicode::strtolower($this->randomMachineName());
// Create a field with settings to validate.
- $this->fieldStorage = entity_create('field_storage_config', array(
+ $this->fieldStorage = FieldStorageConfig::create(array(
'field_name' => $field_name,
'entity_type' => 'entity_test',
'type' => 'link',
@@ -476,7 +477,7 @@ class LinkFieldTest extends WebTestBase {
function testLinkSeparateFormatter() {
$field_name = Unicode::strtolower($this->randomMachineName());
// Create a field with settings to validate.
- $this->fieldStorage = entity_create('field_storage_config', array(
+ $this->fieldStorage = FieldStorageConfig::create(array(
'field_name' => $field_name,
'entity_type' => 'entity_test',
'type' => 'link',
diff --git a/core/modules/node/src/Tests/MultiStepNodeFormBasicOptionsTest.php b/core/modules/node/src/Tests/MultiStepNodeFormBasicOptionsTest.php
index 84ffbe2..496994b 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\FieldStorageConfig;
/**
* Tests the persistence of basic options through multiple steps.
@@ -32,7 +33,7 @@ class MultiStepNodeFormBasicOptionsTest extends NodeTestBase {
// Create an unlimited cardinality field.
$this->fieldName = Unicode::strtolower($this->randomMachineName());
- entity_create('field_storage_config', array(
+ FieldStorageConfig::create(array(
'field_name' => $this->fieldName,
'entity_type' => 'node',
'type' => 'text',
diff --git a/core/modules/node/src/Tests/NodeAccessFieldTest.php b/core/modules/node/src/Tests/NodeAccessFieldTest.php
index ab490bb..02ef26f 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\FieldStorageConfig;
/**
* Tests the interaction of the node access system with fields.
@@ -54,7 +55,7 @@ class NodeAccessFieldTest extends NodeTestBase {
// Add a custom field to the page content type.
$this->fieldName = Unicode::strtolower($this->randomMachineName() . '_field_name');
- entity_create('field_storage_config', array(
+ FieldStorageConfig::create(array(
'field_name' => $this->fieldName,
'entity_type' => 'node',
'type' => 'text'
diff --git a/core/modules/node/src/Tests/NodeAccessLanguageAwareCombinationTest.php b/core/modules/node/src/Tests/NodeAccessLanguageAwareCombinationTest.php
index 3051af1..25cba88 100644
--- a/core/modules/node/src/Tests/NodeAccessLanguageAwareCombinationTest.php
+++ b/core/modules/node/src/Tests/NodeAccessLanguageAwareCombinationTest.php
@@ -11,6 +11,7 @@ use Drupal\Core\Language\LanguageInterface;
use Drupal\language\Entity\ConfigurableLanguage;
use Drupal\node\Entity\NodeType;
use Drupal\user\Entity\User;
+use Drupal\field\Entity\FieldStorageConfig;
/**
* Tests node access functionality with multiple languages and two node access
@@ -55,7 +56,7 @@ class NodeAccessLanguageAwareCombinationTest extends NodeTestBase {
// Create the 'private' field, which allows the node to be marked as private
// (restricted access) in a given translation.
- $field_storage = entity_create('field_storage_config', array(
+ $field_storage = FieldStorageConfig::create(array(
'field_name' => 'field_private',
'entity_type' => 'node',
'type' => 'boolean',
diff --git a/core/modules/node/src/Tests/NodeAccessLanguageAwareTest.php b/core/modules/node/src/Tests/NodeAccessLanguageAwareTest.php
index 5770746..a72f62b 100644
--- a/core/modules/node/src/Tests/NodeAccessLanguageAwareTest.php
+++ b/core/modules/node/src/Tests/NodeAccessLanguageAwareTest.php
@@ -10,6 +10,7 @@ namespace Drupal\node\Tests;
use Drupal\Core\Language\LanguageInterface;
use Drupal\language\Entity\ConfigurableLanguage;
use Drupal\user\Entity\User;
+use Drupal\field\Entity\FieldStorageConfig;
/**
* Tests node_access and db_select() with node_access tag functionality with
@@ -52,7 +53,7 @@ class NodeAccessLanguageAwareTest extends NodeTestBase {
// Create the 'private' field, which allows the node to be marked as private
// (restricted access) in a given translation.
- $field_storage = entity_create('field_storage_config', array(
+ $field_storage = FieldStorageConfig::create(array(
'field_name' => 'field_private',
'entity_type' => 'node',
'type' => 'boolean',
diff --git a/core/modules/options/src/Tests/OptionsDynamicValuesTestBase.php b/core/modules/options/src/Tests/OptionsDynamicValuesTestBase.php
index 0bc99f0..16451d5 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\FieldStorageConfig;
/**
* Base class for testing allowed values of options fields.
@@ -39,7 +40,7 @@ abstract class OptionsDynamicValuesTestBase extends FieldTestBase {
parent::setUp();
$field_name = 'test_options';
- $this->fieldStorage = entity_create('field_storage_config', [
+ $this->fieldStorage = FieldStorageConfig::create([
'field_name' => $field_name,
'entity_type' => 'entity_test_rev',
'type' => 'list_string',
diff --git a/core/modules/options/src/Tests/OptionsFieldTest.php b/core/modules/options/src/Tests/OptionsFieldTest.php
index a7d3ffe..fdf1f6d 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\FieldStorageConfig;
/**
* Tests for the 'Options' field types.
@@ -75,7 +76,7 @@ class OptionsFieldTest extends OptionsFieldUnitTestBase {
// Options are reset when a new field with the same name is created.
$this->fieldStorage->delete();
- entity_create('field_storage_config', $this->fieldStorageDefinition)->save();
+ FieldStorageConfig::create($this->fieldStorageDefinition)->save();
entity_create('field_config', array(
'field_name' => $this->fieldName,
'entity_type' => 'entity_test',
diff --git a/core/modules/options/src/Tests/OptionsFieldUITest.php b/core/modules/options/src/Tests/OptionsFieldUITest.php
index d4219c6..48a5b9a 100644
--- a/core/modules/options/src/Tests/OptionsFieldUITest.php
+++ b/core/modules/options/src/Tests/OptionsFieldUITest.php
@@ -267,7 +267,7 @@ class OptionsFieldUITest extends FieldTestBase {
*/
protected function createOptionsField($type) {
// Create a field.
- entity_create('field_storage_config', array(
+ FieldStorageConfig::create(array(
'field_name' => $this->fieldName,
'entity_type' => 'node',
'type' => $type,
diff --git a/core/modules/options/src/Tests/OptionsFieldUnitTestBase.php b/core/modules/options/src/Tests/OptionsFieldUnitTestBase.php
index fcfe4f8..8349384 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\FieldStorageConfig;
/**
* Base class for Options module integration tests.
@@ -66,7 +67,7 @@ abstract class OptionsFieldUnitTestBase extends FieldUnitTestBase {
'allowed_values' => array(1 => 'One', 2 => 'Two', 3 => 'Three'),
),
);
- $this->fieldStorage = entity_create('field_storage_config', $this->fieldStorageDefinition);
+ $this->fieldStorage = FieldStorageConfig::create($this->fieldStorageDefinition);
$this->fieldStorage->save();
$this->field = entity_create('field_config', array(
diff --git a/core/modules/options/src/Tests/OptionsWidgetsTest.php b/core/modules/options/src/Tests/OptionsWidgetsTest.php
index 93293ca..d162442 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\FieldStorageConfig;
/**
* Tests the Options widgets.
@@ -42,7 +43,7 @@ class OptionsWidgetsTest extends FieldTestBase {
parent::setUp();
// Field storage with cardinality 1.
- $this->card1 = entity_create('field_storage_config', [
+ $this->card1 = FieldStorageConfig::create([
'field_name' => 'card_1',
'entity_type' => 'entity_test',
'type' => 'list_integer',
@@ -62,7 +63,7 @@ class OptionsWidgetsTest extends FieldTestBase {
$this->card1->save();
// Field storage with cardinality 2.
- $this->card2 = entity_create('field_storage_config', [
+ $this->card2 = FieldStorageConfig::create([
'field_name' => 'card_2',
'entity_type' => 'entity_test',
'type' => 'list_integer',
diff --git a/core/modules/options/src/Tests/Views/ViewsDataTest.php b/core/modules/options/src/Tests/Views/ViewsDataTest.php
index f743f4c..eb81496 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\FieldStorageConfig;
+
/**
* Test to ensure views data is properly created for the Options module.
*
@@ -32,7 +34,7 @@ class ViewsDataTest extends OptionsTestBase {
parent::setUp();
$field_name = 'test_options';
- $this->fieldStorage = entity_create('field_storage_config', [
+ $this->fieldStorage = FieldStorageConfig::create([
'field_name' => $field_name,
'entity_type' => 'entity_test',
'type' => 'list_string',
diff --git a/core/modules/quickedit/src/Tests/QuickEditTestBase.php b/core/modules/quickedit/src/Tests/QuickEditTestBase.php
index eb779ad..1b75bd3 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\FieldStorageConfig;
/**
* Base class for testing Quick Edit functionality.
@@ -70,7 +71,7 @@ abstract class QuickEditTestBase extends KernelTestBase {
*/
protected function createFieldWithStorage($field_name, $type, $cardinality, $label, $field_settings, $widget_type, $widget_settings, $formatter_type, $formatter_settings) {
$field_storage = $field_name . '_field_storage';
- $this->fields->$field_storage = entity_create('field_storage_config', array(
+ $this->fields->$field_storage = FieldStorageConfig::create(array(
'field_name' => $field_name,
'entity_type' => 'entity_test',
'type' => $type,
diff --git a/core/modules/rdf/src/Tests/Field/FieldRdfaTestBase.php b/core/modules/rdf/src/Tests/Field/FieldRdfaTestBase.php
index cb8f584..2696d17 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\FieldStorageConfig;
abstract class FieldRdfaTestBase extends FieldUnitTestBase {
@@ -114,7 +115,7 @@ abstract class FieldRdfaTestBase extends FieldUnitTestBase {
* (optional) An array of field settings.
*/
protected function createTestField($field_settings = array()) {
- entity_create('field_storage_config', array(
+ FieldStorageConfig::create(array(
'field_name' => $this->fieldName,
'entity_type' => 'entity_test',
'type' => $this->fieldType,
diff --git a/core/modules/serialization/src/Tests/EntityResolverTest.php b/core/modules/serialization/src/Tests/EntityResolverTest.php
index e362b8d..6bc9fb8 100644
--- a/core/modules/serialization/src/Tests/EntityResolverTest.php
+++ b/core/modules/serialization/src/Tests/EntityResolverTest.php
@@ -8,6 +8,7 @@ namespace Drupal\serialization\Tests;
use Drupal\Core\Url;
use Drupal\entity_test\Entity\EntityTestMulRev;
+use Drupal\field\Entity\FieldStorageConfig;
/**
* Tests that entities references can be resolved.
@@ -36,7 +37,7 @@ class EntityResolverTest extends NormalizerTestBase {
\Drupal::service('router.builder')->rebuild();
// Create the test field storage.
- entity_create('field_storage_config', array(
+ FieldStorageConfig::create(array(
'entity_type' => 'entity_test_mulrev',
'field_name' => 'field_test_entity_reference',
'type' => 'entity_reference',
diff --git a/core/modules/simpletest/src/Tests/KernelTestBaseTest.php b/core/modules/simpletest/src/Tests/KernelTestBaseTest.php
index 2187ccc..1c2ae55 100644
--- a/core/modules/simpletest/src/Tests/KernelTestBaseTest.php
+++ b/core/modules/simpletest/src/Tests/KernelTestBaseTest.php
@@ -9,6 +9,7 @@ namespace Drupal\simpletest\Tests;
use Drupal\Core\Database\Database;
use Drupal\simpletest\KernelTestBase;
+use Drupal\field\Entity\FieldStorageConfig;
/**
* Tests KernelTestBase functionality.
@@ -277,7 +278,7 @@ EOS;
'bundle' => 'entity_test',
'mode' => 'default',
));
- $field_storage = entity_create('field_storage_config', array(
+ $field_storage = FieldStorageConfig::create(array(
'field_name' => 'test_field',
'entity_type' => 'entity_test',
'type' => 'test_field'
diff --git a/core/modules/system/src/Tests/Ajax/MultiFormTest.php b/core/modules/system/src/Tests/Ajax/MultiFormTest.php
index f87100d..c9bfa1e 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\FieldStorageConfig;
/**
* Tests that AJAX-enabled forms work when multiple instances of the same form
@@ -31,7 +32,7 @@ class MultiFormTest extends AjaxTestBase {
// Create a multi-valued field for 'page' nodes to use for Ajax testing.
$field_name = 'field_ajax_test';
- entity_create('field_storage_config', array(
+ FieldStorageConfig::create(array(
'entity_type' => 'node',
'field_name' => $field_name,
'type' => 'text',
diff --git a/core/modules/system/src/Tests/Entity/EntityCacheTagsTestBase.php b/core/modules/system/src/Tests/Entity/EntityCacheTagsTestBase.php
index dd35bbd..07d82ac 100644
--- a/core/modules/system/src/Tests/Entity/EntityCacheTagsTestBase.php
+++ b/core/modules/system/src/Tests/Entity/EntityCacheTagsTestBase.php
@@ -73,7 +73,7 @@ abstract class EntityCacheTagsTestBase extends PageCacheTagsTestBase {
if ($this->entity->getEntityType()->get('field_ui_base_route')) {
// Add field, so we can modify the field storage and field entities to
// verify that changes to those indeed clear cache tags.
- entity_create('field_storage_config', array(
+ FieldStorageConfig::create(array(
'field_name' => 'configurable_field',
'entity_type' => $this->entity->getEntityTypeId(),
'type' => 'test_field',
@@ -246,7 +246,7 @@ abstract class EntityCacheTagsTestBase extends PageCacheTagsTestBase {
// Add a field of the given type to the given entity type's "foo" bundle.
$field_name = $referenced_entity->getEntityTypeId() . '_reference';
- entity_create('field_storage_config', array(
+ FieldStorageConfig::create(array(
'field_name' => $field_name,
'entity_type' => $entity_type,
'type' => 'entity_reference',
diff --git a/core/modules/system/src/Tests/Entity/EntityLanguageTestBase.php b/core/modules/system/src/Tests/Entity/EntityLanguageTestBase.php
index 61a5ad2..33a0845 100644
--- a/core/modules/system/src/Tests/Entity/EntityLanguageTestBase.php
+++ b/core/modules/system/src/Tests/Entity/EntityLanguageTestBase.php
@@ -10,6 +10,7 @@ namespace Drupal\system\Tests\Entity;
use Drupal\Component\Utility\Unicode;
use Drupal\language\Entity\ConfigurableLanguage;
use Drupal\field\Entity\FieldConfig;
+use Drupal\field\Entity\FieldStorageConfig;
/**
* Base class for language-aware entity tests.
@@ -75,7 +76,7 @@ abstract class EntityLanguageTestBase extends EntityUnitTestBase {
// Create field fields in all entity variations.
foreach (entity_test_entity_types() as $entity_type) {
- entity_create('field_storage_config', array(
+ FieldStorageConfig::create(array(
'field_name' => $this->fieldName,
'entity_type' => $entity_type,
'type' => 'text',
@@ -89,7 +90,7 @@ abstract class EntityLanguageTestBase extends EntityUnitTestBase {
))->save();
$this->field[$entity_type] = FieldConfig::load($entity_type . '.' . $entity_type . '.' . $this->fieldName);
- entity_create('field_storage_config', array(
+ FieldStorageConfig::create(array(
'field_name' => $this->untranslatableFieldName,
'entity_type' => $entity_type,
'type' => 'text',
diff --git a/core/modules/system/src/Tests/Entity/EntityQueryAggregateTest.php b/core/modules/system/src/Tests/Entity/EntityQueryAggregateTest.php
index a3262ea..77b7c7e 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\FieldStorageConfig;
+
/**
* Tests the Entity Query Aggregation API.
*
@@ -51,7 +53,7 @@ class EntityQueryAggregateTest extends EntityUnitTestBase {
// Add some fieldapi fields to be used in the test.
for ($i = 1; $i <= 2; $i++) {
$field_name = 'field_test_' . $i;
- entity_create('field_storage_config', array(
+ FieldStorageConfig::create(array(
'field_name' => $field_name,
'entity_type' => 'entity_test',
'type' => 'integer',
diff --git a/core/modules/system/src/Tests/Entity/EntityQueryTest.php b/core/modules/system/src/Tests/Entity/EntityQueryTest.php
index 932e5fb..0d4b641 100644
--- a/core/modules/system/src/Tests/Entity/EntityQueryTest.php
+++ b/core/modules/system/src/Tests/Entity/EntityQueryTest.php
@@ -71,7 +71,7 @@ class EntityQueryTest extends EntityUnitTestBase {
$figures = Unicode::strtolower($this->randomMachineName());
$greetings = Unicode::strtolower($this->randomMachineName());
foreach (array($figures => 'shape', $greetings => 'text') as $field_name => $field_type) {
- $field_storage = entity_create('field_storage_config', array(
+ $field_storage = FieldStorageConfig::create(array(
'field_name' => $field_name,
'entity_type' => 'entity_test_mulrev',
'type' => $field_type,
@@ -458,7 +458,7 @@ class EntityQueryTest extends EntityUnitTestBase {
public function testCount() {
// Create a field with the same name in a different entity type.
$field_name = $this->figures;
- $field_storage = entity_create('field_storage_config', array(
+ $field_storage = FieldStorageConfig::create(array(
'field_name' => $field_name,
'entity_type' => 'entity_test',
'type' => 'shape',
diff --git a/core/modules/system/src/Tests/Entity/EntityReferenceSelection/EntityReferenceSelectionSortTest.php b/core/modules/system/src/Tests/Entity/EntityReferenceSelection/EntityReferenceSelectionSortTest.php
index 3d0d4d1..80b56e5 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\Component\Utility\Html;
use Drupal\node\Entity\Node;
use Drupal\node\Entity\NodeType;
use Drupal\system\Tests\Entity\EntityUnitTestBase;
+use Drupal\field\Entity\FieldStorageConfig;
/**
* Tests sorting referenced items.
@@ -45,7 +46,7 @@ class EntityReferenceSelectionSortTest extends EntityUnitTestBase {
*/
public function testSort() {
// Add text field to entity, to sort by.
- entity_create('field_storage_config', array(
+ FieldStorageConfig::create(array(
'field_name' => 'field_text',
'entity_type' => 'node',
'type' => 'text',
diff --git a/core/modules/system/src/Tests/Entity/FieldSqlStorageTest.php b/core/modules/system/src/Tests/Entity/FieldSqlStorageTest.php
index 67b0e94..582bf87 100644
--- a/core/modules/system/src/Tests/Entity/FieldSqlStorageTest.php
+++ b/core/modules/system/src/Tests/Entity/FieldSqlStorageTest.php
@@ -84,7 +84,7 @@ class FieldSqlStorageTest extends EntityUnitTestBase {
$this->fieldName = strtolower($this->randomMachineName());
$this->fieldCardinality = 4;
- $this->fieldStorage = entity_create('field_storage_config', array(
+ $this->fieldStorage = FieldStorageConfig::create(array(
'field_name' => $this->fieldName,
'entity_type' => $entity_type,
'type' => 'test_field',
@@ -282,7 +282,7 @@ class FieldSqlStorageTest extends EntityUnitTestBase {
$values = array();
for ($i = 0; $i < 2; $i++) {
$field_names[$i] = $name_base . $i;
- entity_create('field_storage_config', array(
+ FieldStorageConfig::create(array(
'field_name' => $field_names[$i],
'entity_type' => $entity_type,
'type' => 'test_field',
@@ -312,7 +312,7 @@ class FieldSqlStorageTest extends EntityUnitTestBase {
function testUpdateFieldSchemaWithData() {
$entity_type = 'entity_test_rev';
// Create a decimal 5.2 field and add some data.
- $field_storage = entity_create('field_storage_config', array(
+ $field_storage = FieldStorageConfig::create(array(
'field_name' => 'decimal52',
'entity_type' => $entity_type,
'type' => 'decimal',
@@ -347,7 +347,7 @@ class FieldSqlStorageTest extends EntityUnitTestBase {
*/
function testFieldUpdateFailure() {
// Create a text field.
- $field_storage = entity_create('field_storage_config', array(
+ $field_storage = FieldStorageConfig::create(array(
'field_name' => 'test_text',
'entity_type' => 'entity_test_rev',
'type' => 'text',
@@ -387,7 +387,7 @@ class FieldSqlStorageTest extends EntityUnitTestBase {
// Create a decimal field.
$field_name = 'testfield';
$entity_type = 'entity_test_rev';
- $field_storage = entity_create('field_storage_config', array(
+ $field_storage = FieldStorageConfig::create(array(
'field_name' => $field_name,
'entity_type' => $entity_type,
'type' => 'text',
@@ -443,7 +443,7 @@ class FieldSqlStorageTest extends EntityUnitTestBase {
// field_test_field_schema()).
$field_name = 'testfield';
$foreign_key_name = 'shape';
- $field_storage = entity_create('field_storage_config', array(
+ $field_storage = FieldStorageConfig::create(array(
'field_name' => $field_name,
'entity_type' => 'entity_test',
'type' => 'shape',
@@ -480,7 +480,7 @@ class FieldSqlStorageTest extends EntityUnitTestBase {
// Short entity type and field name.
$entity_type = 'short_entity_type';
$field_name = 'short_field_name';
- $field_storage = entity_create('field_storage_config', array(
+ $field_storage = FieldStorageConfig::create(array(
'entity_type' => $entity_type,
'field_name' => $field_name,
'type' => 'test_field',
@@ -493,7 +493,7 @@ class FieldSqlStorageTest extends EntityUnitTestBase {
// Short entity type, long field name
$entity_type = 'short_entity_type';
$field_name = 'long_field_name_abcdefghijklmnopqrstuvwxyz';
- $field_storage = entity_create('field_storage_config', array(
+ $field_storage = FieldStorageConfig::create(array(
'entity_type' => $entity_type,
'field_name' => $field_name,
'type' => 'test_field',
@@ -506,7 +506,7 @@ class FieldSqlStorageTest extends EntityUnitTestBase {
// Long entity type, short field name
$entity_type = 'long_entity_type_abcdefghijklmnopqrstuvwxyz';
$field_name = 'short_field_name';
- $field_storage = entity_create('field_storage_config', array(
+ $field_storage = FieldStorageConfig::create(array(
'entity_type' => $entity_type,
'field_name' => $field_name,
'type' => 'test_field',
@@ -519,7 +519,7 @@ class FieldSqlStorageTest extends EntityUnitTestBase {
// Long entity type and field name.
$entity_type = 'long_entity_type_abcdefghijklmnopqrstuvwxyz';
$field_name = 'long_field_name_abcdefghijklmnopqrstuvwxyz';
- $field_storage = entity_create('field_storage_config', array(
+ $field_storage = FieldStorageConfig::create(array(
'entity_type' => $entity_type,
'field_name' => $field_name,
'type' => 'test_field',
@@ -529,7 +529,7 @@ class FieldSqlStorageTest extends EntityUnitTestBase {
$expected = 'long_entity_type_abcdefghijklmnopq_r__' . substr(hash('sha256', $field_storage->uuid()), 0, 10);
$this->assertEqual($this->tableMapping->getDedicatedRevisionTableName($field_storage), $expected);
// Try creating a second field and check there are no clashes.
- $field_storage2 = entity_create('field_storage_config', array(
+ $field_storage2 = FieldStorageConfig::create(array(
'entity_type' => $entity_type,
'field_name' => $field_name . '2',
'type' => 'test_field',
@@ -538,7 +538,7 @@ class FieldSqlStorageTest extends EntityUnitTestBase {
$this->assertNotEqual($this->tableMapping->getDedicatedRevisionTableName($field_storage), $this->tableMapping->getDedicatedRevisionTableName($field_storage2));
// Deleted field.
- $field_storage = entity_create('field_storage_config', array(
+ $field_storage = FieldStorageConfig::create(array(
'entity_type' => 'some_entity_type',
'field_name' => 'some_field_name',
'type' => 'test_field',
diff --git a/core/modules/system/src/Tests/Form/ArbitraryRebuildTest.php b/core/modules/system/src/Tests/Form/ArbitraryRebuildTest.php
index 09eba7b..da8d812 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\FieldStorageConfig;
/**
* Tests altering forms to be rebuilt so there are multiple steps.
@@ -27,7 +28,7 @@ class ArbitraryRebuildTest extends WebTestBase {
parent::setUp();
// Auto-create a field for testing.
- entity_create('field_storage_config', array(
+ FieldStorageConfig::create(array(
'entity_type' => 'user',
'field_name' => 'test_multiple',
'type' => 'text',
diff --git a/core/modules/system/src/Tests/Form/RebuildTest.php b/core/modules/system/src/Tests/Form/RebuildTest.php
index 7674241..161b1b7 100644
--- a/core/modules/system/src/Tests/Form/RebuildTest.php
+++ b/core/modules/system/src/Tests/Form/RebuildTest.php
@@ -10,6 +10,7 @@ namespace Drupal\system\Tests\Form;
use Drupal\Core\Field\FieldStorageDefinitionInterface;
use Drupal\Core\Url;
use Drupal\simpletest\WebTestBase;
+use Drupal\field\Entity\FieldStorageConfig;
/**
* Tests functionality of \Drupal\Core\Form\FormBuilderInterface::rebuildForm().
@@ -73,7 +74,7 @@ class RebuildTest extends WebTestBase {
function testPreserveFormActionAfterAJAX() {
// Create a multi-valued field for 'page' nodes to use for Ajax testing.
$field_name = 'field_ajax_test';
- entity_create('field_storage_config', array(
+ FieldStorageConfig::create(array(
'field_name' => $field_name,
'entity_type' => 'node',
'type' => 'text',
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..b6369da 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\FieldStorageConfig;
/**
* Implements hook_install().
@@ -13,7 +14,7 @@ use Drupal\system\Tests\Update\DbUpdatesTrait;
function entity_test_install() {
foreach (entity_test_entity_types() as $entity_type) {
// Auto-create fields for testing.
- entity_create('field_storage_config', array(
+ FieldStorageConfig::create(array(
'entity_type' => $entity_type,
'field_name' => 'field_test_text',
'type' => 'text',
diff --git a/core/modules/taxonomy/src/Tests/TaxonomyImageTest.php b/core/modules/taxonomy/src/Tests/TaxonomyImageTest.php
index 550c5f5..b4c9d78 100644
--- a/core/modules/taxonomy/src/Tests/TaxonomyImageTest.php
+++ b/core/modules/taxonomy/src/Tests/TaxonomyImageTest.php
@@ -9,6 +9,7 @@ namespace Drupal\taxonomy\Tests;
use Drupal\user\RoleInterface;
use Drupal\file\Entity\File;
+use Drupal\field\Entity\FieldStorageConfig;
/**
* Tests access checks of private image fields.
@@ -41,7 +42,7 @@ class TaxonomyImageTest extends TaxonomyTestBase {
// Add a field to the vocabulary.
$entity_type = 'taxonomy_term';
$name = 'field_test';
- entity_create('field_storage_config', array(
+ FieldStorageConfig::create(array(
'field_name' => $name,
'entity_type' => $entity_type,
'type' => 'image',
diff --git a/core/modules/taxonomy/src/Tests/Views/TaxonomyFieldFilterTest.php b/core/modules/taxonomy/src/Tests/Views/TaxonomyFieldFilterTest.php
index 5dec796..446b2f0 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\language\Entity\ConfigurableLanguage;
use Drupal\views\Tests\ViewTestBase;
use Drupal\views\Tests\ViewTestData;
use Drupal\views\Views;
+use Drupal\field\Entity\FieldStorageConfig;
/**
* Tests taxonomy field filters with translations.
@@ -68,7 +69,7 @@ class TaxonomyFieldFilterTest extends ViewTestBase {
$this->vocabulary->save();
// Add a translatable field to the vocabulary.
- $field = entity_create('field_storage_config', array(
+ $field = FieldStorageConfig::create(array(
'field_name' => 'field_foo',
'entity_type' => 'taxonomy_term',
'type' => 'text',
diff --git a/core/modules/taxonomy/src/Tests/VocabularyCrudTest.php b/core/modules/taxonomy/src/Tests/VocabularyCrudTest.php
index 6596b8e..cb967f0 100644
--- a/core/modules/taxonomy/src/Tests/VocabularyCrudTest.php
+++ b/core/modules/taxonomy/src/Tests/VocabularyCrudTest.php
@@ -9,6 +9,7 @@ namespace Drupal\taxonomy\Tests;
use Drupal\Component\Utility\Unicode;
use Drupal\taxonomy\Entity\Vocabulary;
+use Drupal\field\Entity\FieldStorageConfig;
/**
* Tests loading, saving and deleting vocabularies.
@@ -154,7 +155,7 @@ class VocabularyCrudTest extends TaxonomyTestBase {
'type' => 'text',
'cardinality' => 4
);
- entity_create('field_storage_config', $storage_definition)->save();
+ FieldStorageConfig::create($storage_definition)->save();
$field_definition = array(
'field_name' => $field_name,
'entity_type' => 'taxonomy_term',
@@ -178,7 +179,7 @@ class VocabularyCrudTest extends TaxonomyTestBase {
// an instance of this field on the same bundle name should be successful.
$this->vocabulary->enforceIsNew();
$this->vocabulary->save();
- entity_create('field_storage_config', $storage_definition)->save();
+ FieldStorageConfig::create($storage_definition)->save();
entity_create('field_config', $field_definition)->save();
}
}
diff --git a/core/modules/telephone/src/Tests/TelephoneFieldTest.php b/core/modules/telephone/src/Tests/TelephoneFieldTest.php
index 515d7e0..2942d1a 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\FieldStorageConfig;
/**
* Tests the creation of telephone fields.
@@ -50,7 +51,7 @@ class TelephoneFieldTest extends WebTestBase {
function testTelephoneField() {
// Add the telephone field to the article content type.
- entity_create('field_storage_config', array(
+ FieldStorageConfig::create(array(
'field_name' => 'field_telephone',
'entity_type' => 'node',
'type' => 'telephone',
diff --git a/core/modules/telephone/src/Tests/TelephoneItemTest.php b/core/modules/telephone/src/Tests/TelephoneItemTest.php
index 42b7973..d6b6549 100644
--- a/core/modules/telephone/src/Tests/TelephoneItemTest.php
+++ b/core/modules/telephone/src/Tests/TelephoneItemTest.php
@@ -10,6 +10,7 @@ namespace Drupal\telephone\Tests;
use Drupal\Core\Field\FieldItemListInterface;
use Drupal\Core\Field\FieldItemInterface;
use Drupal\field\Tests\FieldUnitTestBase;
+use Drupal\field\Entity\FieldStorageConfig;
/**
* Tests the new entity API for the telephone field type.
@@ -29,7 +30,7 @@ class TelephoneItemTest extends FieldUnitTestBase {
parent::setUp();
// Create a telephone field storage and field for validation.
- entity_create('field_storage_config', array(
+ FieldStorageConfig::create(array(
'field_name' => 'field_test',
'entity_type' => 'entity_test',
'type' => 'telephone',
diff --git a/core/modules/text/src/Tests/Formatter/TextFormatterTest.php b/core/modules/text/src/Tests/Formatter/TextFormatterTest.php
index 324f2cf..cd4a86c 100644
--- a/core/modules/text/src/Tests/Formatter/TextFormatterTest.php
+++ b/core/modules/text/src/Tests/Formatter/TextFormatterTest.php
@@ -9,6 +9,7 @@ namespace Drupal\text\Tests\Formatter;
use Drupal\filter\Entity\FilterFormat;
use Drupal\system\Tests\Entity\EntityUnitTestBase;
+use Drupal\field\Entity\FieldStorageConfig;
/**
* Tests the text formatters functionality.
@@ -55,7 +56,7 @@ class TextFormatterTest extends EntityUnitTestBase {
),
))->save();
- entity_create('field_storage_config', array(
+ FieldStorageConfig::create(array(
'field_name' => 'formatted_text',
'entity_type' => $this->entityType,
'type' => 'text',
diff --git a/core/modules/text/src/Tests/TextFieldTest.php b/core/modules/text/src/Tests/TextFieldTest.php
index 8279a6d..cb46bea 100644
--- a/core/modules/text/src/Tests/TextFieldTest.php
+++ b/core/modules/text/src/Tests/TextFieldTest.php
@@ -9,6 +9,7 @@ namespace Drupal\text\Tests;
use Drupal\Component\Utility\Unicode;
use Drupal\field\Tests\String\StringFieldTest;
+use Drupal\field\Entity\FieldStorageConfig;
/**
* Tests the creation of text fields.
@@ -39,7 +40,7 @@ class TextFieldTest extends StringFieldTest {
// Create a field with settings to validate.
$max_length = 3;
$field_name = Unicode::strtolower($this->randomMachineName());
- $field_storage = entity_create('field_storage_config', array(
+ $field_storage = FieldStorageConfig::create(array(
'field_name' => $field_name,
'entity_type' => 'entity_test',
'type' => 'text',
@@ -73,7 +74,7 @@ class TextFieldTest extends StringFieldTest {
function testRequiredLongTextWithFileUpload() {
// Create a text field.
$text_field_name = 'text_long';
- $field_storage = entity_create('field_storage_config', array(
+ $field_storage = FieldStorageConfig::create(array(
'field_name' => $text_field_name,
'entity_type' => 'entity_test',
'type' => 'text_with_summary',
@@ -88,7 +89,7 @@ class TextFieldTest extends StringFieldTest {
// Create a file field.
$file_field_name = 'file_field';
- $field_storage = entity_create('field_storage_config', array(
+ $field_storage = FieldStorageConfig::create(array(
'field_name' => $file_field_name,
'entity_type' => 'entity_test',
'type' => 'file'
@@ -151,7 +152,7 @@ class TextFieldTest extends StringFieldTest {
// Create a field.
$field_name = Unicode::strtolower($this->randomMachineName());
- $field_storage = entity_create('field_storage_config', array(
+ $field_storage = FieldStorageConfig::create(array(
'field_name' => $field_name,
'entity_type' => 'entity_test',
'type' => $field_type
diff --git a/core/modules/text/src/Tests/TextWithSummaryItemTest.php b/core/modules/text/src/Tests/TextWithSummaryItemTest.php
index e292ffd..7e78980 100644
--- a/core/modules/text/src/Tests/TextWithSummaryItemTest.php
+++ b/core/modules/text/src/Tests/TextWithSummaryItemTest.php
@@ -10,6 +10,7 @@ namespace Drupal\text\Tests;
use Drupal\Core\Field\FieldItemListInterface;
use Drupal\Core\Field\FieldItemInterface;
use Drupal\field\Tests\FieldUnitTestBase;
+use Drupal\field\Entity\FieldStorageConfig;
/**
* Tests using entity fields of the text summary field type.
@@ -98,7 +99,7 @@ class TextWithSummaryItemTest extends FieldUnitTestBase {
*/
protected function createField($entity_type) {
// Create a field .
- $this->fieldStorage = entity_create('field_storage_config', array(
+ $this->fieldStorage = FieldStorageConfig::create(array(
'field_name' => 'summary_field',
'entity_type' => $entity_type,
'type' => 'text_with_summary',
diff --git a/core/modules/user/src/Tests/UserCreateTest.php b/core/modules/user/src/Tests/UserCreateTest.php
index 2674f09..8ad3905 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\FieldStorageConfig;
/**
* Tests the create user administration page.
@@ -36,7 +37,7 @@ class UserCreateTest extends WebTestBase {
// Create a field.
$field_name = 'test_field';
- entity_create('field_storage_config', array(
+ FieldStorageConfig::create(array(
'field_name' => $field_name,
'entity_type' => 'user',
'module' => 'image',
diff --git a/core/modules/user/src/Tests/UserRegistrationTest.php b/core/modules/user/src/Tests/UserRegistrationTest.php
index 1e16bc7..ad33d83 100644
--- a/core/modules/user/src/Tests/UserRegistrationTest.php
+++ b/core/modules/user/src/Tests/UserRegistrationTest.php
@@ -288,7 +288,7 @@ class UserRegistrationTest extends WebTestBase {
*/
function testRegistrationWithUserFields() {
// Create a field on 'user' entity type.
- $field_storage = entity_create('field_storage_config', array(
+ $field_storage = FieldStorageConfig::create(array(
'field_name' => 'test_user_field',
'entity_type' => 'user',
'type' => 'test_field',
diff --git a/core/modules/views/src/Tests/Entity/ViewEntityDependenciesTest.php b/core/modules/views/src/Tests/Entity/ViewEntityDependenciesTest.php
index 632be6a..b86aade 100644
--- a/core/modules/views/src/Tests/Entity/ViewEntityDependenciesTest.php
+++ b/core/modules/views/src/Tests/Entity/ViewEntityDependenciesTest.php
@@ -57,7 +57,7 @@ class ViewEntityDependenciesTest extends ViewKernelTestBase {
'name' => $this->randomString(),
));
$content_type->save();
- $field_storage = entity_create('field_storage_config', array(
+ $field_storage = FieldStorageConfig::create(array(
'field_name' => Unicode::strtolower($this->randomMachineName()),
'entity_type' => 'node',
'type' => 'comment',
diff --git a/core/modules/views/src/Tests/Handler/FieldGroupRowsTest.php b/core/modules/views/src/Tests/Handler/FieldGroupRowsTest.php
index 9cfd854..a7d278b 100644
--- a/core/modules/views/src/Tests/Handler/FieldGroupRowsTest.php
+++ b/core/modules/views/src/Tests/Handler/FieldGroupRowsTest.php
@@ -10,6 +10,7 @@ namespace Drupal\views\Tests\Handler;
use Drupal\Core\Field\FieldStorageDefinitionInterface;
use Drupal\Core\Render\RenderContext;
use Drupal\views\Views;
+use Drupal\field\Entity\FieldStorageConfig;
/**
* Tests the "Display all values in the same row" setting.
@@ -48,7 +49,7 @@ class FieldGroupRowsTest extends HandlerTestBase {
$node_type = $this->drupalCreateContentType(array('type' => 'page', 'name' => 'Basic page'));
// Create the unlimited text field.
- $field_storage = entity_create('field_storage_config', array(
+ $field_storage = FieldStorageConfig::create(array(
'field_name' => $this->fieldName,
'entity_type' => 'node',
'type' => 'text',