function ModerationStateViewsFieldUpdateTest::testViewsFieldIdUpdate

Test the views field ID update.

File

core/modules/content_moderation/tests/src/Functional/Update/ModerationStateViewsFieldUpdateTest.php, line 32

Class

ModerationStateViewsFieldUpdateTest
Test updating the views moderation state field plugin ID.

Namespace

Drupal\Tests\content_moderation\Functional\Update

Code

public function testViewsFieldIdUpdate() {
    $views_display = View::load('moderated_content')->getDisplay('default');
    $this->assertEquals('field', $views_display['display_options']['fields']['moderation_state']['plugin_id']);
    $this->runUpdates();
    $views_display = View::load('moderated_content')->getDisplay('default');
    $this->assertEquals('moderation_state_field', $views_display['display_options']['fields']['moderation_state']['plugin_id']);
}

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