function 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 23

Class

ModerationStateNodeTypeTest
Tests moderation state node type integration.

Namespace

Drupal\Tests\content_moderation\Functional

Code

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

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