function FieldUpdateTest::testEntityReferenceFieldConfigCleanUpdate

Tests field_post_update_remove_handler_submit_setting().

See also

field_post_update_remove_handler_submit_setting()

File

core/modules/field/tests/src/Functional/Update/FieldUpdateTest.php, line 254

Class

FieldUpdateTest
Tests that field settings are properly updated during database updates.

Namespace

Drupal\Tests\field\Functional\Update

Code

public function testEntityReferenceFieldConfigCleanUpdate() {
    $field_config = $this->config('field.field.node.article.field_tags');
    // Check that 'handler_submit' key exists in field config settings.
    $this->assertEquals('Change handler', $field_config->get('settings.handler_submit'));
    $this->runUpdates();
    $field_config = $this->config('field.field.node.article.field_tags');
    // Check that 'handler_submit' has been removed from field config settings.
    $this->assertArrayNotHasKey('handler_submit', $field_config->get('settings'));
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.