Commit 33b66b50 authored by alexpott's avatar alexpott

Issue #2377115 by mglaman: Replace all instances of...

Issue #2377115 by mglaman: Replace all instances of entity_load('field_config') and entity_load_multiple('field_config') with static method calls
parent dd1350fb
......@@ -59,7 +59,7 @@ function testCommentDefaultFields() {
// Test adding a field that defaults to CommentItemInterface::CLOSED.
$this->container->get('comment.manager')->addDefaultField('node', 'test_node_type', 'who_likes_ponies', CommentItemInterface::CLOSED, 'who_likes_ponies');
$field = entity_load('field_config', 'node.test_node_type.who_likes_ponies');
$field = FieldConfig::load('node.test_node_type.who_likes_ponies');
$this->assertEqual($field->default_value[0]['status'], CommentItemInterface::CLOSED);
}
......
......@@ -8,6 +8,7 @@
namespace Drupal\comment\Tests;
use Drupal\comment\Entity\Comment;
use Drupal\field\Entity\FieldConfig;
/**
* Tests that comments behave correctly when the node is changed.
......@@ -28,10 +29,10 @@ function testNodeDeletion() {
// 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(entity_load('field_config', 'node.article.comment'), 'Comment field 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(entity_load('field_config', 'node.article.comment'), 'Comment field deleted');
$this->assertNull(FieldConfig::load('node.article.comment'), 'Comment field deleted');
}
}
......@@ -9,6 +9,7 @@
use Drupal\Component\Utility\Unicode;
use Drupal\Core\Archiver\ArchiveTar;
use Drupal\field\Entity\FieldConfig;
use Drupal\simpletest\WebTestBase;
/**
......@@ -97,7 +98,7 @@ public function testExportImport() {
$this->assertEqual(\Drupal::config('system.site')->get('slogan'), $this->originalSlogan);
// Delete the custom field.
$fields = entity_load_multiple('field_config');
$fields = FieldConfig::loadMultiple();
foreach ($fields as $field) {
if ($field->field_name == $this->fieldName) {
$field->delete();
......
......@@ -8,6 +8,7 @@
use Drupal\Core\Entity\EntityTypeInterface;
use Drupal\Core\Entity\DynamicallyFieldableEntityStorageInterface;
use Drupal\Core\Extension\Extension;
use Drupal\field\Entity\FieldConfig;
use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\Routing\RouteMatchInterface;
use Drupal\Core\Url;
......@@ -182,7 +183,7 @@ function field_entity_bundle_field_info(EntityTypeInterface $entity_type, $bundl
->condition('id', $entity_type->id() . '.' . $bundle . '.', 'STARTS_WITH')
->execute();
// Fetch all fields and key them by field name.
$field_configs = entity_load_multiple('field_config', $ids);
$field_configs = FieldConfig::loadMultiple($ids);
$result = array();
foreach ($field_configs as $field_instance) {
$result[$field_instance->getName()] = $field_instance;
......
......@@ -371,8 +371,8 @@ function testEntityDeleteBundle() {
$this->assertTrue(empty($entity->{$field_name}), 'No data for second field');
// Verify that the fields are gone.
$this->assertFalse(entity_load('field_config', 'entity_test.' . $this->fieldTestData->field->bundle . '.' . $this->fieldTestData->field_name), "First field is deleted");
$this->assertFalse(entity_load('field_config', 'entity_test.' . $field['bundle']. '.' . $field_name), "Second field is deleted");
$this->assertFalse(FieldConfig::load('entity_test.' . $this->fieldTestData->field->bundle . '.' . $this->fieldTestData->field_name), "First field is deleted");
$this->assertFalse(FieldConfig::load('entity_test.' . $field['bundle']. '.' . $field_name), "Second field is deleted");
}
}
......@@ -117,7 +117,7 @@ function testReadField() {
entity_create('field_config', $this->fieldDefinition)->save();
// Read the field back.
$field = entity_load('field_config', 'entity_test.' . $this->fieldDefinition['bundle'] . '.' . $this->fieldDefinition['field_name']);
$field = FieldConfig::load('entity_test.' . $this->fieldDefinition['bundle'] . '.' . $this->fieldDefinition['field_name']);
$this->assertTrue($this->fieldDefinition['field_name'] == $field->getName(), 'The field was properly read.');
$this->assertTrue($this->fieldDefinition['entity_type'] == $field->entity_type, 'The field was properly read.');
$this->assertTrue($this->fieldDefinition['bundle'] == $field->bundle, 'The field was properly read.');
......@@ -130,14 +130,14 @@ function testUpdateField() {
entity_create('field_config', $this->fieldDefinition)->save();
// Check that basic changes are saved.
$field = entity_load('field_config', 'entity_test.' . $this->fieldDefinition['bundle'] . '.' . $this->fieldDefinition['field_name']);
$field = FieldConfig::load('entity_test.' . $this->fieldDefinition['bundle'] . '.' . $this->fieldDefinition['field_name']);
$field->required = !$field->isRequired();
$field->label = $this->randomMachineName();
$field->description = $this->randomMachineName();
$field->settings['test_field_setting'] = $this->randomMachineName();
$field->save();
$field_new = entity_load('field_config', 'entity_test.' . $this->fieldDefinition['bundle'] . '.' . $this->fieldDefinition['field_name']);
$field_new = FieldConfig::load('entity_test.' . $this->fieldDefinition['bundle'] . '.' . $this->fieldDefinition['field_name']);
$this->assertEqual($field->isRequired(), $field_new->isRequired(), '"required" change is saved');
$this->assertEqual($field->getLabel(), $field_new->getLabel(), '"label" change is saved');
$this->assertEqual($field->getDescription(), $field_new->getDescription(), '"description" change is saved');
......@@ -171,11 +171,11 @@ function testDeleteField() {
$this->assertTrue(!empty($field->deleted), 'A deleted field is marked for deletion.');
// Try to load the field normally and make sure it does not show up.
$field = entity_load('field_config', 'entity_test.' . '.' . $this->fieldDefinition['bundle'] . '.' . $this->fieldDefinition['field_name']);
$field = FieldConfig::load('entity_test.' . '.' . $this->fieldDefinition['bundle'] . '.' . $this->fieldDefinition['field_name']);
$this->assertTrue(empty($field), 'A deleted field is not loaded by default.');
// Make sure the other field is not deleted.
$another_field = entity_load('field_config', 'entity_test.' . $another_field_definition['bundle'] . '.' . $another_field_definition['field_name']);
$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 non-deleted field is not marked for deletion.');
}
......
......@@ -7,6 +7,8 @@
namespace Drupal\field\Tests;
use Drupal\field\Entity\FieldConfig;
/**
* Update field storage and fields during config change method invocation.
*
......@@ -45,7 +47,7 @@ function testImportChange() {
$this->configImporter()->import();
// Check that the updated config was correctly imported.
$field = entity_load('field_config', $field_id);
$field = FieldConfig::load($field_id);
$this->assertEqual($field->getLabel(), $new_label, 'field label updated');
}
}
......
......@@ -7,6 +7,8 @@
namespace Drupal\field\Tests;
use Drupal\field\Entity\FieldConfig;
/**
* Create field storages and fields during config create method invocation.
*
......@@ -28,10 +30,10 @@ function testImportCreateDefault() {
// Check that the field storages and fields do not exist yet.
$this->assertFalse(entity_load('field_storage_config', $field_storage_id));
$this->assertFalse(entity_load('field_config', $field_id));
$this->assertFalse(FieldConfig::load($field_id));
$this->assertFalse(entity_load('field_storage_config', $field_storage_id_2));
$this->assertFalse(entity_load('field_config', $field_id_2a));
$this->assertFalse(entity_load('field_config', $field_id_2b));
$this->assertFalse(FieldConfig::load($field_id_2a));
$this->assertFalse(FieldConfig::load($field_id_2b));
// Create a second bundle for the 'Entity test' entity type.
entity_test_create_bundle('test_bundle');
......@@ -43,7 +45,7 @@ function testImportCreateDefault() {
// A field storage with one single field.
$field_storage = entity_load('field_storage_config', $field_storage_id);
$this->assertTrue($field_storage, 'The field was created.');
$field = entity_load('field_config', $field_id);
$field = FieldConfig::load($field_id);
$this->assertTrue($field, 'The field was deleted.');
// A field storage with two fields.
......@@ -107,13 +109,13 @@ function testImportCreate() {
// Check that the field and storage were created.
$field_storage = entity_load('field_storage_config', $field_storage_id);
$this->assertTrue($field_storage, 'Test import storage field from staging exists');
$field = entity_load('field_config', $field_id);
$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);
$this->assertTrue($field_storage, 'Test import storage field 2 from staging exists');
$field = entity_load('field_config', $field_id_2a);
$field = FieldConfig::load($field_id_2a);
$this->assertTrue($field, 'Test import field 2a from staging exists');
$field = entity_load('field_config', $field_id_2b);
$field = FieldConfig::load($field_id_2b);
$this->assertTrue($field, 'Test import field 2b from staging exists');
}
}
......
......@@ -8,6 +8,7 @@
namespace Drupal\field\Tests;
use Drupal\Component\Utility\String;
use Drupal\field\Entity\FieldConfig;
/**
* Delete field storages and fields during config delete method invocation.
......@@ -78,11 +79,14 @@ public function testImportDelete() {
$this->assertFalse($field_storage, 'The field storage was deleted.');
$field_storage_2 = entity_load('field_storage_config', $field_storage_id_2, TRUE);
$this->assertFalse($field_storage_2, 'The second field storage was deleted.');
$field = entity_load('field_config', $field_id, TRUE);
\Drupal::entityManager()->getStorage('field_config')->resetCache(array($field_id));
$field = FieldConfig::load($field_id);
$this->assertFalse($field, 'The field was deleted.');
$field_2a = entity_load('field_config', $field_id_2a, TRUE);
\Drupal::entityManager()->getStorage('field_config')->resetCache(array($field_id_2a));
$field_2a = FieldConfig::load($field_id_2a);
$this->assertFalse($field_2a, 'The second field on test bundle was deleted.');
$field_2b = entity_load('field_config', $field_id_2b, TRUE);
\Drupal::entityManager()->getStorage('field_config')->resetCache(array($field_id_2b));
$field_2b = FieldConfig::load($field_id_2b);
$this->assertFalse($field_2b, 'The second field on test bundle 2 was deleted.');
// Check that all config files are gone.
......
......@@ -10,6 +10,7 @@
use Drupal\Core\Entity\EntityStorageException;
use Drupal\Core\Entity\Exception\FieldStorageDefinitionUpdateForbiddenException;
use Drupal\Core\Field\FieldException;
use Drupal\field\Entity\FieldConfig;
use Drupal\field\Entity\FieldStorageConfig;
/**
......@@ -322,13 +323,13 @@ function testDelete() {
$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.
$field = entity_load('field_config', 'entity_test.' . '.' . $field_definition['bundle'] . '.' . $field_definition['field_name']);
$field = FieldConfig::load('entity_test.' . '.' . $field_definition['bundle'] . '.' . $field_definition['field_name']);
$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']);
$this->assertTrue(!empty($another_field_storage) && empty($another_field_storage->deleted), 'A non-deleted storage is not marked for deletion.');
$another_field = entity_load('field_config', 'entity_test.' . $another_field_definition['bundle'] . '.' . $another_field_definition['field_name']);
$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.');
// Try to create a new field the same name as a deleted field and
......@@ -337,7 +338,7 @@ function testDelete() {
entity_create('field_config', $field_definition)->save();
$field_storage = entity_load('field_storage_config', '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 = entity_load('field_config', 'entity_test.' . $field_definition['bundle'] . '.' . $field_definition['field_name'] );
$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.');
// Save an entity with data for the field
......
......@@ -8,6 +8,7 @@
namespace Drupal\field\Tests;
use Drupal\Component\Utility\Unicode;
use Drupal\field\Entity\FieldConfig;
use Drupal\language\Entity\ConfigurableLanguage;
/**
......@@ -72,7 +73,7 @@ protected function setUp() {
'bundle' => $this->entity_type,
);
entity_create('field_config', $field)->save();
$this->field = entity_load('field_config', $this->entity_type . '.' . $field['bundle'] . '.' . $this->field_name);
$this->field = FieldConfig::load($this->entity_type . '.' . $field['bundle'] . '.' . $this->field_name);
entity_get_form_display($this->entity_type, $this->entity_type, 'default')
->setComponent($this->field_name)
......
......@@ -492,7 +492,7 @@ function testHiddenFields() {
entity_get_form_display('node', $this->type, 'default')
->setComponent($field_name)
->save();
$this->assertTrue(entity_load('field_config', 'node.' . $this->type . '.' . $field_name), format_string('A field of the field storage %field was created programmatically.', array('%field' => $field_name)));
$this->assertTrue(FieldConfig::load('node.' . $this->type . '.' . $field_name), format_string('A field of the field storage %field was created programmatically.', array('%field' => $field_name)));
// Check that the newly added field appears on the 'Manage Fields'
// screen.
......
......@@ -7,6 +7,7 @@
namespace Drupal\migrate_drupal\Tests\d6;
use Drupal\field\Entity\FieldConfig;
use Drupal\migrate\MigrateExecutable;
use Drupal\migrate_drupal\Tests\MigrateDrupalTestBase;
use Drupal\link\LinkItemInterface;
......@@ -83,14 +84,14 @@ protected function setUp() {
public function testFieldInstanceSettings() {
$entity = entity_create('node', array('type' => 'story'));
// Test a text field.
$field = entity_load('field_config', 'node.story.field_test');
$field = FieldConfig::load('node.story.field_test');
$this->assertEqual($field->label(), 'Text Field');
$expected = array('max_length' => 255);
$this->assertEqual($field->getSettings(), $expected);
$this->assertEqual('text for default value', $entity->field_test->value);
// Test a number field.
$field = entity_load('field_config', 'node.story.field_test_two');
$field = FieldConfig::load('node.story.field_test_two');
$this->assertEqual($field->label(), 'Integer Field');
$expected = array(
'min' => '10',
......@@ -102,7 +103,7 @@ public function testFieldInstanceSettings() {
);
$this->assertEqual($field->getSettings(), $expected);
$field = entity_load('field_config', 'node.story.field_test_four');
$field = FieldConfig::load('node.story.field_test_four');
$this->assertEqual($field->label(), 'Float Field');
$expected = array(
'min' => 100,
......@@ -113,12 +114,12 @@ public function testFieldInstanceSettings() {
$this->assertEqual($field->getSettings(), $expected);
// Test email field.
$field = entity_load('field_config', 'node.story.field_test_email');
$field = FieldConfig::load('node.story.field_test_email');
$this->assertEqual($field->label(), 'Email Field');
$this->assertEqual('benjy@example.com', $entity->field_test_email->value, 'Field field_test_email default_value is correct.');
// Test a filefield.
$field = entity_load('field_config', 'node.story.field_test_filefield');
$field = FieldConfig::load('node.story.field_test_filefield');
$this->assertEqual($field->label(), 'File Field');
$expected = array(
'file_extensions' => 'txt pdf doc',
......@@ -137,7 +138,7 @@ public function testFieldInstanceSettings() {
$this->assertFalse(array_diff_assoc($expected, $field->getSettings()));
// Test a link field.
$field = entity_load('field_config', 'node.story.field_test_link');
$field = FieldConfig::load('node.story.field_test_link');
$this->assertEqual($field->label(), 'Link Field');
$expected = array('title' => 2, 'link_type' => LinkItemInterface::LINK_GENERIC);
$this->assertEqual($field->getSettings(), $expected);
......
......@@ -7,6 +7,7 @@
namespace Drupal\migrate_drupal\Tests\d6;
use Drupal\field\Entity\FieldConfig;
use Drupal\migrate\MigrateExecutable;
use Drupal\migrate_drupal\Tests\MigrateDrupalTestBase;
......@@ -64,18 +65,18 @@ protected function setUp() {
* Tests the Drupal 6 upload settings to Drupal 8 field instance migration.
*/
public function testUploadFieldInstance() {
$field = entity_load('field_config', 'node.page.upload');
$field = FieldConfig::load('node.page.upload');
$settings = $field->getSettings();
$this->assertEqual($field->id(), 'node.page.upload');
$this->assertEqual($settings['file_extensions'], 'jpg jpeg gif png txt doc xls pdf ppt pps odt ods odp');
$this->assertEqual($settings['max_filesize'], '1MB');
$this->assertEqual($settings['description_field'], TRUE);
$field = entity_load('field_config', 'node.story.upload');
$field = FieldConfig::load('node.story.upload');
$this->assertEqual($field->id(), 'node.story.upload');
// Shouldn't exist.
$field = entity_load('field_config', 'node.article.upload');
$field = FieldConfig::load('node.article.upload');
$this->assertTrue(is_null($field));
$this->assertEqual(array('node', 'page', 'upload'), entity_load('migration', 'd6_upload_field_instance')->getIdMap()->lookupDestinationID(array('page')));
......
......@@ -7,6 +7,7 @@
namespace Drupal\migrate_drupal\Tests\d6;
use Drupal\field\Entity\FieldConfig;
use Drupal\migrate\MigrateExecutable;
use Drupal\migrate_drupal\Tests\MigrateDrupalTestBase;
......@@ -52,7 +53,7 @@ protected function setUp() {
* Tests the Drupal 6 user picture to Drupal 8 picture field instance migration.
*/
public function testUserPictureFieldInstance() {
$field = entity_load('field_config', 'user.user.user_picture');
$field = FieldConfig::load('user.user.user_picture');
$settings = $field->getSettings();
$this->assertEqual($settings['file_extensions'], 'png gif jpg jpeg');
$this->assertEqual($settings['file_directory'], 'pictures');
......
......@@ -7,6 +7,7 @@
namespace Drupal\migrate_drupal\Tests\d6;
use Drupal\field\Entity\FieldConfig;
use Drupal\migrate\MigrateExecutable;
use Drupal\migrate_drupal\Tests\MigrateDrupalTestBase;
......@@ -49,44 +50,44 @@ protected function setUp() {
*/
public function testUserProfileFields() {
// Migrated a text field.
$field = entity_load('field_config', 'user.user.profile_color');
$field = FieldConfig::load('user.user.profile_color');
$this->assertEqual($field->label(), 'Favorite color');
$this->assertEqual($field->getDescription(), 'List your favorite color');
// Migrated a textarea.
$field = entity_load('field_config', 'user.user.profile_biography');
$field = FieldConfig::load('user.user.profile_biography');
$this->assertEqual($field->label(), 'Biography');
$this->assertEqual($field->getDescription(), 'Tell people a little bit about yourself');
// Migrated checkbox field.
$field = entity_load('field_config', 'user.user.profile_sell_address');
$field = FieldConfig::load('user.user.profile_sell_address');
$this->assertEqual($field->label(), 'Sell your email address?');
$this->assertEqual($field->getDescription(), "If you check this box, we'll sell your address to spammers to help line the pockets of our shareholders. Thanks!");
// Migrated selection field.
$field = entity_load('field_config', 'user.user.profile_sold_to');
$field = FieldConfig::load('user.user.profile_sold_to');
$this->assertEqual($field->label(), 'Sales Category');
$this->assertEqual($field->getDescription(), "Select the sales categories to which this user's address was sold.");
// Migrated list field.
$field = entity_load('field_config', 'user.user.profile_bands');
$field = FieldConfig::load('user.user.profile_bands');
$this->assertEqual($field->label(), 'Favorite bands');
$this->assertEqual($field->getDescription(), "Enter your favorite bands. When you've saved your profile, you'll be able to find other people with the same favorites.");
/*
// Migrated URL field.
$field = entity_load('field_config', 'user.user.profile_blog');
$field = FieldConfig::load('user.user.profile_blog');
$this->assertEqual($field->label(), 'Your blog');
$this->assertEqual($field->getDescription(), "Paste the full URL, including http://, of your personal blog.");
*/
// Migrated date field.
$field = entity_load('field_config', 'user.user.profile_birthdate');
$field = FieldConfig::load('user.user.profile_birthdate');
$this->assertEqual($field->label(), 'Birthdate');
$this->assertEqual($field->getDescription(), "Enter your birth date and we'll send you a coupon.");
// Another migrated checkbox field, with a different source visibility setting.
$field = entity_load('field_config', 'user.user.profile_love_migrations');
$field = FieldConfig::load('user.user.profile_love_migrations');
$this->assertEqual($field->label(), 'I love migrations');
$this->assertEqual($field->getDescription(), "If you check this box, you love migrations.");
}
......
......@@ -8,6 +8,7 @@
namespace Drupal\migrate_drupal\Tests\d6;
use Drupal\Core\Field\FieldStorageDefinitionInterface;
use Drupal\field\Entity\FieldConfig;
use Drupal\migrate\MigrateExecutable;
use Drupal\migrate_drupal\Tests\MigrateDrupalTestBase;
......@@ -83,12 +84,12 @@ protected function setUp() {
public function testVocabularyFieldInstance() {
// Test that the field exists.
$field_id = 'node.article.tags';
$field = entity_load('field_config', $field_id);
$field = FieldConfig::load($field_id);
$this->assertEqual($field->id(), $field_id, 'Field instance exists on article bundle.');
// Test the page bundle as well.
$field_id = 'node.page.tags';
$field = entity_load('field_config', $field_id);
$field = FieldConfig::load($field_id);
$this->assertEqual($field->id(), $field_id, 'Field instance exists on page bundle.');
$this->assertEqual(array('node', 'article', 'tags'), entity_load('migration', 'd6_vocabulary_field_instance')->getIdMap()->lookupDestinationID(array(4, 'article')));
......
......@@ -10,6 +10,7 @@
use Drupal\Core\Cache\Cache;
use Drupal\Core\Entity\EntityInterface;
use Drupal\Core\Field\FieldStorageDefinitionInterface;
use Drupal\field\Entity\FieldConfig;
use Drupal\system\Tests\Cache\PageCacheTagsTestBase;
use Drupal\user\Entity\Role;
......@@ -486,7 +487,7 @@ public function testReferencedEntity() {
// is a cache miss.
$this->pass("Test modification of referenced entity's configurable field.", 'Debug');
$field_name = $this->entity->getEntityTypeId() . '.' . $this->entity->bundle() . '.configurable_field';
$field = entity_load('field_config', $field_name);
$field = FieldConfig::load($field_name);
$field->save();
$this->verifyPageCache($referencing_entity_path, 'MISS');
$this->verifyPageCache($listing_path, 'MISS');
......
......@@ -83,7 +83,7 @@ protected function setUp() {
'bundle' => $entity_type,
'translatable' => TRUE,
))->save();
$this->field[$entity_type] = entity_load('field_config', $entity_type . '.' . $entity_type . '.' . $this->field_name);
$this->field[$entity_type] = FieldConfig::load($entity_type . '.' . $entity_type . '.' . $this->field_name);
entity_create('field_storage_config', array(
'field_name' => $this->untranslatable_field_name,
......
......@@ -8,6 +8,7 @@
namespace Drupal\system\Tests\Entity;
use Drupal\Core\Cache\Cache;
use Drupal\field\Entity\FieldConfig;
/**
* Provides helper methods for Entity cache tags tests; for entities with URIs.
......@@ -98,7 +99,7 @@ public function testEntityUri() {
// is a cache miss.
$this->pass("Test modification of entity's configurable field.", 'Debug');
$field_name = $this->entity->getEntityTypeId() . '.' . $this->entity->bundle() . '.configurable_field';
$field = entity_load('field_config', $field_name);
$field = FieldConfig::load($field_name);
$field->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