You are here

public function ModerationStateNodeTypeTest::testEnforceRevisionsEntityFormAlter in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/content_moderation/tests/src/Functional/ModerationStateNodeTypeTest.php \Drupal\Tests\content_moderation\Functional\ModerationStateNodeTypeTest::testEnforceRevisionsEntityFormAlter()

@covers \Drupal\content_moderation\Entity\Handler\NodeModerationHandler::enforceRevisionsBundleFormAlter

File

core/modules/content_moderation/tests/src/Functional/ModerationStateNodeTypeTest.php, line 108

Class

ModerationStateNodeTypeTest
Tests moderation state node type integration.

Namespace

Drupal\Tests\content_moderation\Functional

Code

public function testEnforceRevisionsEntityFormAlter() {
  $this
    ->drupalLogin($this->adminUser);
  $this
    ->createContentTypeFromUi('Moderated', 'moderated');

  // Ensure checkboxes in the 'workflow' section can be altered, even when
  // 'revision' is enforced and disabled.
  $this
    ->drupalGet('admin/structure/types/manage/moderated');
  $this
    ->drupalPostForm('admin/structure/types/manage/moderated', [
    'options[promote]' => TRUE,
  ], 'Save content type');
  $this
    ->drupalGet('admin/structure/types/manage/moderated');
  $this
    ->assertSession()
    ->checkboxChecked('options[promote]');
}