function ModerationStateNodeTypeTest::testEnforceRevisionsEntityFormAlter

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()
  2. 8.9.x core/modules/content_moderation/tests/src/Functional/ModerationStateNodeTypeTest.php \Drupal\Tests\content_moderation\Functional\ModerationStateNodeTypeTest::testEnforceRevisionsEntityFormAlter()
  3. 11.x 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 111

Class

ModerationStateNodeTypeTest
Tests moderation state node type integration.

Namespace

Drupal\Tests\content_moderation\Functional

Code

public function testEnforceRevisionsEntityFormAlter() : void {
  $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->submitForm([
    'options[promote]' => TRUE,
  ], 'Save');
  $this->drupalGet('admin/structure/types/manage/moderated');
  $this->assertSession()
    ->checkboxChecked('options[promote]');
}

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