Commit 4d8bd967 authored by alexpott's avatar alexpott

Issue #2377117 by mglaman, rpayanm, pcambra: Replace all instances of...

Issue #2377117 by mglaman, rpayanm, pcambra: Replace all instances of entity_load('field_storage_config') and entity_load_multiple('field_storage_config') with static method calls
parent b8dee6c8
......@@ -9,6 +9,7 @@
use Drupal\comment\Entity\Comment;
use Drupal\field\Entity\FieldConfig;
use Drupal\field\Entity\FieldStorageConfig;
/**
* Tests that comments behave correctly when the node is changed.
......@@ -28,11 +29,11 @@ function testNodeDeletion() {
$this->assertFalse(Comment::load($comment->id()), 'The comment could not be loaded after the node was deleted.');
// Make sure the comment field storage and all its fields are deleted when
// the node type is deleted.
$this->assertNotNull(entity_load('field_storage_config', 'node.comment'), 'Comment field storage exists');
$this->assertNotNull(FieldStorageConfig::load('node.comment'), 'Comment field storage exists');
$this->assertNotNull(FieldConfig::load('node.article.comment'), 'Comment field exists');
// Delete the node type.
entity_delete_multiple('node_type', array($this->node->bundle()));
$this->assertNull(entity_load('field_storage_config', 'node.comment'), 'Comment field storage deleted');
$this->assertNull(FieldStorageConfig::load('node.comment'), 'Comment field storage deleted');
$this->assertNull(FieldConfig::load('node.article.comment'), 'Comment field deleted');
}
}
......@@ -11,6 +11,7 @@
use Drupal\comment\Entity\CommentType;
use Drupal\comment\Plugin\Field\FieldType\CommentItemInterface;
use Drupal\field\Entity\FieldConfig;
use Drupal\field\Entity\FieldStorageConfig;
use Drupal\field_ui\Tests\FieldUiTestTrait;
use Drupal\simpletest\WebTestBase;
use Drupal\Core\Entity\EntityInterface;
......@@ -385,7 +386,7 @@ function testCommentFunctionality() {
$this->fieldUIAddNewField('entity_test/structure/entity_test', 'barfoo', 'BarFoo', 'comment', $storage_edit);
// Check the field contains the correct comment type.
$field_storage = entity_load('field_storage_config', 'entity_test.field_barfoo');
$field_storage = FieldStorageConfig::load('entity_test.field_barfoo');
$this->assertTrue($field_storage);
$this->assertEqual($field_storage->getSetting('comment_type'), 'foobar');
$this->assertEqual($field_storage->getCardinality(), 1);
......
......@@ -10,6 +10,7 @@
use Drupal\Component\Utility\Unicode;
use Drupal\Core\Archiver\ArchiveTar;
use Drupal\field\Entity\FieldConfig;
use Drupal\field\Entity\FieldStorageConfig;
use Drupal\simpletest\WebTestBase;
/**
......@@ -140,7 +141,7 @@ public function testExportImport() {
$field->delete();
}
}
$field_storages = entity_load_multiple('field_storage_config');
$field_storages = FieldStorageConfig::loadMultiple();
foreach ($field_storages as $field_storage) {
if ($field_storage->field_name == $this->fieldName) {
$field_storage->delete();
......
......@@ -12,6 +12,7 @@
use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\Routing\RouteMatchInterface;
use Drupal\Core\Url;
use Drupal\field\Entity\FieldStorageConfig;
/*
* Load all public Field API functions. Drupal currently has no
......@@ -162,7 +163,7 @@ function field_entity_field_storage_info(\Drupal\Core\Entity\EntityTypeInterface
->condition('id', $entity_type->id() . '.', 'STARTS_WITH')
->execute();
// Fetch all fields and key them by field name.
$field_storages = entity_load_multiple('field_storage_config', $ids);
$field_storages = FieldStorageConfig::loadMultiple($ids);
$result = array();
foreach ($field_storages as $field_storage) {
$result[$field_storage->getName()] = $field_storage;
......
......@@ -9,6 +9,8 @@
use Drupal\field\Entity\FieldConfig;
use Drupal\field\Entity\FieldStorageConfig;
/**
* Create field storages and fields during config create method invocation.
*
......@@ -29,9 +31,9 @@ function testImportCreateDefault() {
$field_id_2b = "entity_test.test_bundle.$field_name_2";
// Check that the field storages and fields do not exist yet.
$this->assertFalse(entity_load('field_storage_config', $field_storage_id));
$this->assertFalse(FieldStorageConfig::load($field_storage_id));
$this->assertFalse(FieldConfig::load($field_id));
$this->assertFalse(entity_load('field_storage_config', $field_storage_id_2));
$this->assertFalse(FieldStorageConfig::load($field_storage_id_2));
$this->assertFalse(FieldConfig::load($field_id_2a));
$this->assertFalse(FieldConfig::load($field_id_2b));
......@@ -43,13 +45,13 @@ function testImportCreateDefault() {
\Drupal::service('module_installer')->install(array('field_test_config'));
// A field storage with one single field.
$field_storage = entity_load('field_storage_config', $field_storage_id);
$field_storage = FieldStorageConfig::load($field_storage_id);
$this->assertTrue($field_storage, 'The field was created.');
$field = FieldConfig::load($field_id);
$this->assertTrue($field, 'The field was deleted.');
// A field storage with two fields.
$field_storage_2 = entity_load('field_storage_config', $field_storage_id_2);
$field_storage_2 = FieldStorageConfig::load($field_storage_id_2);
$this->assertTrue($field_storage_2, 'The second field was created.');
$this->assertTrue($field->bundle, 'test_bundle', 'The second field was created on bundle test_bundle.');
$this->assertTrue($field->bundle, 'test_bundle_2', 'The second field was created on bundle test_bundle_2.');
......@@ -107,11 +109,11 @@ function testImportCreate() {
$this->configImporter()->import();
// Check that the field and storage were created.
$field_storage = entity_load('field_storage_config', $field_storage_id);
$field_storage = FieldStorageConfig::load($field_storage_id);
$this->assertTrue($field_storage, 'Test import storage field from staging exists');
$field = FieldConfig::load($field_id);
$this->assertTrue($field, 'Test import field from staging exists');
$field_storage = entity_load('field_storage_config', $field_storage_id_2);
$field_storage = FieldStorageConfig::load($field_storage_id_2);
$this->assertTrue($field_storage, 'Test import storage field 2 from staging exists');
$field = FieldConfig::load($field_id_2a);
$this->assertTrue($field, 'Test import field 2a from staging exists');
......
......@@ -9,6 +9,7 @@
use Drupal\Component\Utility\String;
use Drupal\field\Entity\FieldConfig;
use Drupal\field\Entity\FieldStorageConfig;
/**
* Delete field storages and fields during config delete method invocation.
......@@ -56,8 +57,8 @@ public function testImportDelete() {
$this->installConfig(array('field_test_config'));
// Get the uuid's for the field storages.
$field_storage_uuid = entity_load('field_storage_config', $field_storage_id)->uuid();
$field_storage_uuid_2 = entity_load('field_storage_config', $field_storage_id_2)->uuid();
$field_storage_uuid = FieldStorageConfig::load($field_storage_id)->uuid();
$field_storage_uuid_2 = FieldStorageConfig::load($field_storage_id_2)->uuid();
$active = $this->container->get('config.storage');
$staging = $this->container->get('config.storage.staging');
......@@ -75,9 +76,11 @@ public function testImportDelete() {
$this->configImporter()->import();
// Check that the field storages and fields are gone.
$field_storage = entity_load('field_storage_config', $field_storage_id, TRUE);
\Drupal::entityManager()->getStorage('field_storage_config')->resetCache(array($field_storage_id));
$field_storage = FieldStorageConfig::load($field_storage_id);
$this->assertFalse($field_storage, 'The field storage was deleted.');
$field_storage_2 = entity_load('field_storage_config', $field_storage_id_2, TRUE);
\Drupal::entityManager()->getStorage('field_storage_config')->resetCache(array($field_storage_id_2));
$field_storage_2 = FieldStorageConfig::load($field_storage_id_2);
$this->assertFalse($field_storage_2, 'The second field storage was deleted.');
\Drupal::entityManager()->getStorage('field_config')->resetCache(array($field_id));
$field = FieldConfig::load($field_id);
......
......@@ -233,7 +233,7 @@ function testIndexes() {
'type' => 'test_field',
));
$field_storage->save();
$field_storage = entity_load('field_storage_config', $field_storage->id());
$field_storage = FieldStorageConfig::load($field_storage->id());
$schema = $field_storage->getSchema();
$expected_indexes = array('value' => array('value'));
$this->assertEqual($schema['indexes'], $expected_indexes, 'Field type indexes saved by default');
......@@ -249,7 +249,7 @@ function testIndexes() {
),
));
$field_storage->save();
$field_storage = entity_load('field_storage_config', $field_storage->id());
$field_storage = FieldStorageConfig::load($field_storage->id());
$schema = $field_storage->getSchema();
$expected_indexes = array('value' => array());
$this->assertEqual($schema['indexes'], $expected_indexes, 'Field definition indexes override field type indexes');
......@@ -266,7 +266,7 @@ function testIndexes() {
));
$field_storage->save();
$id = $field_storage->id();
$field_storage = entity_load('field_storage_config', $id);
$field_storage = FieldStorageConfig::load($id);
$schema = $field_storage->getSchema();
$expected_indexes = array('value' => array('value'), 'value_2' => array('value'));
$this->assertEqual($schema['indexes'], $expected_indexes, 'Field definition indexes are merged with field type indexes');
......@@ -319,7 +319,7 @@ function testDelete() {
$this->assertTrue(!empty($field->deleted), 'A field whose storage was deleted is marked for deletion.');
// Try to load the storage normally and make sure it does not show up.
$field_storage = entity_load('field_storage_config', 'entity_test.' . $field_storage_definition['field_name']);
$field_storage = FieldStorageConfig::load('entity_test.' . $field_storage_definition['field_name']);
$this->assertTrue(empty($field_storage), 'A deleted storage is not loaded by default.');
// Try to load the field normally and make sure it does not show up.
......@@ -327,7 +327,7 @@ function testDelete() {
$this->assertTrue(empty($field), 'A field whose storage was deleted is not loaded by default.');
// Make sure the other field and its storage are not deleted.
$another_field_storage = entity_load('field_storage_config', 'entity_test.' . $another_field_storage_definition['field_name']);
$another_field_storage = FieldStorageConfig::load('entity_test.' . $another_field_storage_definition['field_name']);
$this->assertTrue(!empty($another_field_storage) && empty($another_field_storage->deleted), 'A non-deleted storage is not marked for deletion.');
$another_field = FieldConfig::load('entity_test.' . $another_field_definition['bundle'] . '.' . $another_field_definition['field_name']);
$this->assertTrue(!empty($another_field) && empty($another_field->deleted), 'A field whose storage was not deleted is not marked for deletion.');
......@@ -336,7 +336,7 @@ function testDelete() {
// write data into it.
entity_create('field_storage_config', $field_storage_definition)->save();
entity_create('field_config', $field_definition)->save();
$field_storage = entity_load('field_storage_config', 'entity_test.' . $field_storage_definition['field_name']);
$field_storage = FieldStorageConfig::load('entity_test.' . $field_storage_definition['field_name']);
$this->assertTrue(!empty($field_storage) && empty($field_storage->deleted), 'A new storage with a previously used name is created.');
$field = FieldConfig::load('entity_test.' . $field_definition['bundle'] . '.' . $field_definition['field_name'] );
$this->assertTrue(!empty($field) && empty($field->deleted), 'A new field for a previously used field name is created.');
......
......@@ -8,6 +8,7 @@
namespace Drupal\field\Tests;
use Drupal\Component\Utility\Unicode;
use Drupal\field\Entity\FieldStorageConfig;
use Drupal\field\Entity\FieldConfig;
use Drupal\language\Entity\ConfigurableLanguage;
......@@ -65,7 +66,7 @@ protected function setUp() {
'cardinality' => 4,
);
entity_create('field_storage_config', $field_storage)->save();
$this->fieldStorage = entity_load('field_storage_config', $this->entity_type . '.' . $this->field_name);
$this->fieldStorage = FieldStorageConfig::load($this->entity_type . '.' . $this->field_name);
$field = array(
'field_storage' => $this->fieldStorage,
......
......@@ -7,6 +7,7 @@
namespace Drupal\migrate_drupal\Tests\d6;
use Drupal\field\Entity\FieldStorageConfig;
use Drupal\migrate\MigrateExecutable;
use Drupal\migrate_drupal\Tests\MigrateDrupalTestBase;
......@@ -55,7 +56,7 @@ protected function setUp() {
* Tests comment variables migrated into a field entity.
*/
public function testCommentField() {
$this->assertTrue(is_object(entity_load('field_storage_config', 'node.comment')));
$this->assertTrue(is_object(FieldStorageConfig::load('node.comment')));
}
}
......@@ -7,6 +7,7 @@
namespace Drupal\migrate_drupal\Tests\d6;
use Drupal\field\Entity\FieldStorageConfig;
use Drupal\migrate\MigrateExecutable;
use Drupal\migrate_drupal\Tests\MigrateDrupalTestBase;
......@@ -45,29 +46,29 @@ protected function setUp() {
public function testFields() {
// Text field.
/** @var \Drupal\field\Entity\FieldStorageConfig $field_storage */
$field_storage = entity_load('field_storage_config', 'node.field_test');
$field_storage = FieldStorageConfig::load('node.field_test');
$expected = array('max_length' => 255);
$this->assertEqual($field_storage->type, "text", t('Field type is @fieldtype. It should be text.', array('@fieldtype' => $field_storage->type)));
$this->assertEqual($field_storage->status(), TRUE, "Status is TRUE");
$this->assertEqual($field_storage->settings, $expected, "Field type text settings are correct");
// Integer field.
$field_storage = entity_load('field_storage_config', 'node.field_test_two');
$field_storage = FieldStorageConfig::load('node.field_test_two');
$this->assertEqual($field_storage->type, "integer", t('Field type is @fieldtype. It should be integer.', array('@fieldtype' => $field_storage->type)));
// Float field.
$field_storage = entity_load('field_storage_config', 'node.field_test_three');
$field_storage = FieldStorageConfig::load('node.field_test_three');
$this->assertEqual($field_storage->type, "decimal", t('Field type is @fieldtype. It should be decimal.', array('@fieldtype' => $field_storage->type)));
// Link field.
$field_storage = entity_load('field_storage_config', 'node.field_test_link');
$field_storage = FieldStorageConfig::load('node.field_test_link');
$this->assertEqual($field_storage->type, "link", t('Field type is @fieldtype. It should be link.', array('@fieldtype' => $field_storage->type)));
// File field.
$field_storage = entity_load('field_storage_config', 'node.field_test_filefield');
$field_storage = FieldStorageConfig::load('node.field_test_filefield');
$this->assertEqual($field_storage->type, "file", t('Field type is @fieldtype. It should be file.', array('@fieldtype' => $field_storage->type)));
$field_storage = entity_load('field_storage_config', 'node.field_test_imagefield');
$field_storage = FieldStorageConfig::load('node.field_test_imagefield');
$this->assertEqual($field_storage->type, "image", t('Field type is @fieldtype. It should be image.', array('@fieldtype' => $field_storage->type)));
$settings = $field_storage->getSettings();
$this->assertEqual($settings['target_type'], 'file');
......@@ -76,16 +77,16 @@ public function testFields() {
$this->assertEqual(array_filter($settings['default_image']), array());
// Phone field.
$field_storage = entity_load('field_storage_config', 'node.field_test_phone');
$field_storage = FieldStorageConfig::load('node.field_test_phone');
$this->assertEqual($field_storage->type, "telephone", t('Field type is @fieldtype. It should be telephone.', array('@fieldtype' => $field_storage->type)));
// Date field.
$field_storage = entity_load('field_storage_config', 'node.field_test_datetime');
$field_storage = FieldStorageConfig::load('node.field_test_datetime');
$this->assertEqual($field_storage->type, "datetime", t('Field type is @fieldtype. It should be datetime.', array('@fieldtype' => $field_storage->type)));
$this->assertEqual($field_storage->status(), FALSE, "Status is FALSE");
// Decimal field with radio buttons.
$field_storage = entity_load('field_storage_config', 'node.field_test_decimal_radio_buttons');
$field_storage = FieldStorageConfig::load('node.field_test_decimal_radio_buttons');
$this->assertEqual($field_storage->type, "list_float", t('Field type is @fieldtype. It should be list_float.', array('@fieldtype' => $field_storage->type)));
$this->assertNotNull($field_storage->settings['allowed_values']['1.2'], t('First allowed value key is set to 1.2'));
$this->assertNotNull($field_storage->settings['allowed_values']['2.1'], t('Second allowed value key is set to 2.1'));
......@@ -93,11 +94,11 @@ public function testFields() {
$this->assertEqual($field_storage->settings['allowed_values']['2.1'], '2.1', t('Second allowed value is set to 1.2'));
// Float field with a single checkbox.
$field_storage = entity_load('field_storage_config', 'node.field_test_float_single_checkbox');
$field_storage = FieldStorageConfig::load('node.field_test_float_single_checkbox');
$this->assertEqual($field_storage->type, "boolean", t('Field type is @fieldtype. It should be boolean.', array('@fieldtype' => $field_storage->type)));
// Integer field with a select list.
$field_storage = entity_load('field_storage_config', 'node.field_test_integer_selectlist');
$field_storage = FieldStorageConfig::load('node.field_test_integer_selectlist');
$this->assertEqual($field_storage->type, "list_integer", t('Field type is @fieldtype. It should be list_integer.', array('@fieldtype' => $field_storage->type)));
$this->assertNotNull($field_storage->settings['allowed_values']['1234'], t('First allowed value key is set to 1234'));
$this->assertNotNull($field_storage->settings['allowed_values']['2341'], t('Second allowed value key is set to 2341'));
......@@ -109,7 +110,7 @@ public function testFields() {
$this->assertEqual($field_storage->settings['allowed_values']['4123'], '4123', t('Fourth allowed value is set to 4123'));
// Text field with a single checkbox.
$field_storage = entity_load('field_storage_config', 'node.field_test_text_single_checkbox');
$field_storage = FieldStorageConfig::load('node.field_test_text_single_checkbox');
$this->assertEqual($field_storage->type, "boolean", t('Field type is @fieldtype. It should be boolean.', array('@fieldtype' => $field_storage->type)));
}
......
......@@ -7,6 +7,7 @@
namespace Drupal\migrate_drupal\Tests\d6;
use Drupal\field\Entity\FieldStorageConfig;
use Drupal\migrate\MigrateExecutable;
use Drupal\migrate_drupal\Tests\MigrateDrupalTestBase;
......@@ -42,7 +43,7 @@ protected function setUp() {
* Tests the Drupal 6 upload settings to Drupal 8 field migration.
*/
public function testUpload() {
$field_storage = entity_load('field_storage_config', 'node.upload');
$field_storage = FieldStorageConfig::load('node.upload');
$this->assertEqual($field_storage->id(), 'node.upload');
$this->assertEqual(array('node', 'upload'), entity_load('migration', 'd6_upload_field')->getIdMap()->lookupDestinationID(array('')));
}
......
......@@ -7,6 +7,7 @@
namespace Drupal\migrate_drupal\Tests\d6;
use Drupal\field\Entity\FieldStorageConfig;
use Drupal\migrate\MigrateExecutable;
use Drupal\migrate_drupal\Tests\MigrateDrupalTestBase;
......@@ -33,7 +34,7 @@ protected function setUp() {
* Test the user picture field migration.
*/
public function testUserPictureField() {
$field_storage = entity_load('field_storage_config', 'user.user_picture');
$field_storage = FieldStorageConfig::load('user.user_picture');
$this->assertEqual($field_storage->id(), 'user.user_picture');
$this->assertEqual(array('user', 'user_picture'), entity_load('migration', 'd6_user_picture_field')->getIdMap()->lookupDestinationID(array('')));
}
......
......@@ -7,6 +7,7 @@
namespace Drupal\migrate_drupal\Tests\d6;
use Drupal\field\Entity\FieldStorageConfig;
use Drupal\migrate\MigrateExecutable;
use Drupal\migrate_drupal\Tests\MigrateDrupalTestBase;
......@@ -39,20 +40,20 @@ protected function setUp() {
*/
public function testUserProfileFields() {
// Migrated a text field.
$field_storage = entity_load('field_storage_config', 'user.profile_color');
$field_storage = FieldStorageConfig::load('user.profile_color');
$this->assertEqual($field_storage->type, 'text', 'Field type is text.');
$this->assertEqual($field_storage->cardinality, 1, 'Text field has correct cardinality');
// Migrated a textarea.
$field_storage = entity_load('field_storage_config', 'user.profile_biography');
$field_storage = FieldStorageConfig::load('user.profile_biography');
$this->assertEqual($field_storage->type, 'text_long', 'Field type is text_long.');
// Migrated checkbox field.
$field_storage = entity_load('field_storage_config', 'user.profile_sell_address');
$field_storage = FieldStorageConfig::load('user.profile_sell_address');
$this->assertEqual($field_storage->type, 'boolean', 'Field type is boolean.');
// Migrated selection field.
$field_storage = entity_load('field_storage_config', 'user.profile_sold_to');
$field_storage = FieldStorageConfig::load('user.profile_sold_to');
$this->assertEqual($field_storage->type, 'list_string', 'Field type is list_string.');
$settings = $field_storage->getSettings();
$this->assertEqual($settings['allowed_values'], array(
......@@ -67,18 +68,18 @@ public function testUserProfileFields() {
$this->assertEqual($field_storage->type, 'list_string', 'Field type is list_string.');
// Migrated list field.
$field_storage = entity_load('field_storage_config', 'user.profile_bands');
$field_storage = FieldStorageConfig::load('user.profile_bands');
$this->assertEqual($field_storage->type, 'text', 'Field type is text.');
$this->assertEqual($field_storage->cardinality, -1, 'List field has correct cardinality');
/*
// Migrated URL field.
$field_storage = entity_load('field_storage_config', 'user.profile_blog');
$field_storage = FieldStorageConfig::load('user.profile_blog');
$this->assertEqual($field_storage->type, 'link', 'Field type is link.');
*/
// Migrated date field.
$field_storage = entity_load('field_storage_config', 'user.profile_birthdate');
$field_storage = FieldStorageConfig::load('user.profile_birthdate');
$this->assertEqual($field_storage->type, 'datetime', 'Field type is datetime.');
$this->assertEqual($field_storage->settings['datetime_type'], 'date');
}
......
......@@ -7,6 +7,7 @@
namespace Drupal\migrate_drupal\Tests\d6;
use Drupal\field\Entity\FieldStorageConfig;
use Drupal\migrate\MigrateExecutable;
use Drupal\migrate_drupal\Tests\MigrateDrupalTestBase;
......@@ -59,7 +60,7 @@ protected function setUp() {
public function testVocabularyField() {
// Test that the field exists.
$field_storage_id = 'node.tags';
$field_storage = entity_load('field_storage_config', $field_storage_id);
$field_storage = FieldStorageConfig::load($field_storage_id);
$this->assertEqual($field_storage->id(), $field_storage_id);
$settings = $field_storage->getSettings();
$this->assertEqual('tags', $settings['allowed_values'][0]['vocabulary'], "Vocabulary has correct settings.");
......
......@@ -1756,7 +1756,7 @@ function hook_entity_field_storage_info(\Drupal\Core\Entity\EntityTypeInterface
->condition('id', $entity_type->id() . '.', 'STARTS_WITH')
->execute();
// Fetch all fields and key them by field name.
$field_storages = entity_load_multiple('field_storage_config', $ids);
$field_storages = FieldStorageConfig::loadMultiple($ids);
$result = array();
foreach ($field_storages as $field_storage) {
$result[$field_storage->getName()] = $field_storage;
......
......@@ -10,6 +10,7 @@
use Drupal\Core\Cache\Cache;
use Drupal\Core\Entity\EntityInterface;
use Drupal\Core\Field\FieldStorageDefinitionInterface;
use Drupal\field\Entity\FieldStorageConfig;
use Drupal\field\Entity\FieldConfig;
use Drupal\system\Tests\Cache\PageCacheTagsTestBase;
use Drupal\user\Entity\Role;
......@@ -470,7 +471,7 @@ public function testReferencedEntity() {
// is a cache miss.
$this->pass("Test modification of referenced entity's configurable field.", 'Debug');
$field_storage_name = $this->entity->getEntityTypeId() . '.configurable_field';
$field_storage = entity_load('field_storage_config', $field_storage_name);
$field_storage = FieldStorageConfig::load($field_storage_name);
$field_storage->save();
$this->verifyPageCache($referencing_entity_path, 'MISS');
$this->verifyPageCache($listing_path, 'MISS');
......
......@@ -8,6 +8,7 @@
namespace Drupal\system\Tests\Entity;
use Drupal\Core\Cache\Cache;
use Drupal\field\Entity\FieldStorageConfig;
use Drupal\field\Entity\FieldConfig;
/**
......@@ -88,7 +89,7 @@ public function testEntityUri() {
// is a cache miss.
$this->pass("Test modification of entity's configurable field.", 'Debug');
$field_storage_name = $this->entity->getEntityTypeId() . '.configurable_field';
$field_storage = entity_load('field_storage_config', $field_storage_name);
$field_storage = FieldStorageConfig::load($field_storage_name);
$field_storage->save();
$this->verifyPageCache($entity_path, 'MISS');
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment