You are here

public function WorkbenchModerationSchemaTest::testWorkbenchModerationDefaultConfig in Workbench Moderation 8

Tests workbench moderation default schema.

File

tests/src/Kernel/WorkbenchModerationSchemaTest.php, line 35

Class

WorkbenchModerationSchemaTest
Ensures that workbench moderation schema is correct.

Namespace

Drupal\Tests\workbench_moderation\Kernel

Code

public function testWorkbenchModerationDefaultConfig() {
  $this
    ->installConfig([
    'workbench_moderation',
  ]);
  $typed_config = \Drupal::service('config.typed');
  $moderation_states = ModerationState::loadMultiple();
  foreach ($moderation_states as $moderation_state) {
    $this
      ->assertConfigSchema($typed_config, $moderation_state
      ->getEntityType()
      ->getConfigPrefix() . '.' . $moderation_state
      ->id(), $moderation_state
      ->toArray());
  }
  $moderation_state_transitions = ModerationStateTransition::loadMultiple();
  foreach ($moderation_state_transitions as $moderation_state_transition) {
    $this
      ->assertConfigSchema($typed_config, $moderation_state_transition
      ->getEntityType()
      ->getConfigPrefix() . '.' . $moderation_state_transition
      ->id(), $moderation_state_transition
      ->toArray());
  }
}