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. 10 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 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]');
}

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