function ModerationStateNodeTypeTest::testNotModerated

Same name in other branches
  1. 9 core/modules/content_moderation/tests/src/Functional/ModerationStateNodeTypeTest.php \Drupal\Tests\content_moderation\Functional\ModerationStateNodeTypeTest::testNotModerated()
  2. 8.9.x core/modules/content_moderation/tests/src/Functional/ModerationStateNodeTypeTest.php \Drupal\Tests\content_moderation\Functional\ModerationStateNodeTypeTest::testNotModerated()
  3. 10 core/modules/content_moderation/tests/src/Functional/ModerationStateNodeTypeTest.php \Drupal\Tests\content_moderation\Functional\ModerationStateNodeTypeTest::testNotModerated()

A node type without moderation state disabled.

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

File

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

Class

ModerationStateNodeTypeTest
Tests moderation state node type integration.

Namespace

Drupal\Tests\content_moderation\Functional

Code

public function testNotModerated() : void {
    $this->drupalLogin($this->adminUser);
    $this->createContentTypeFromUi('Not moderated', 'not_moderated');
    $this->assertSession()
        ->pageTextContains('The content type Not moderated has been added.');
    $this->grantUserPermissionToCreateContentOfType($this->adminUser, 'not_moderated');
    $this->drupalGet('node/add/not_moderated');
    $this->assertSession()
        ->pageTextContains('Save');
    $this->submitForm([
        'title[0][value]' => 'Test',
    ], 'Save');
    $this->assertSession()
        ->pageTextContains('Not moderated Test has been created.');
}

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