3 namespace Drupal\field\Tests\Update;
5 use Drupal\system\Tests\Update\UpdatePathTestBase;
8 * Tests the update for the entity reference 'handler' setting.
12 class EntityReferenceHandlerSettingUpdateTest extends UpdatePathTestBase {
17 protected function setDatabaseDumpFiles() {
18 $this->databaseDumpFiles = [
19 __DIR__ . '/../../../../system/tests/fixtures/update/drupal-8.bare.standard.php.gz',
24 * Tests field_post_update_entity_reference_handler_setting().
26 * @see field_post_update_entity_reference_handler_setting()
28 public function testFieldPostUpdateERHandlerSetting() {
29 $configFactory = $this->container->get('config.factory');
31 // Load the 'node.article.field_image' field config, and check that its
32 // 'handler' setting is wrong.
33 /** @var \Drupal\Core\Config\Config */
34 $config = $configFactory->get('field.field.node.article.field_image');
35 $settings = $config->get('settings');
36 $this->assertEqual($settings['handler'], 'default:node');
41 // Reload the config, and check that the 'handler' setting has been fixed.
42 $config = $configFactory->get('field.field.node.article.field_image');
43 $settings = $config->get('settings');
44 $this->assertEqual($settings['handler'], 'default:file');