You are here

public function DefaultModerationStateUpdateTest::testUpdateDefaultModerationState in Drupal 8

Tests updating the default moderation state setting.

File

core/modules/content_moderation/tests/src/Functional/Update/DefaultModerationStateUpdateTest.php, line 31

Class

DefaultModerationStateUpdateTest
Tests the upgrade path for updating the 'default_moderation_state' setting.

Namespace

Drupal\Tests\content_moderation\Functional\Update

Code

public function testUpdateDefaultModerationState() {
  $workflow = Workflow::load('editorial');
  $this
    ->assertArrayNotHasKey('default_moderation_state', $workflow
    ->getTypePlugin()
    ->getConfiguration());
  $this
    ->runUpdates();
  $workflow = Workflow::load('editorial');
  $this
    ->assertEquals('draft', $workflow
    ->getTypePlugin()
    ->getConfiguration()['default_moderation_state']);
}