You are here

public function ModerationStateNodeTypeTest::testNotModerated in Workbench Moderation 8

A node type without moderation state disabled.

File

tests/src/Functional/ModerationStateNodeTypeTest.php, line 15

Class

ModerationStateNodeTypeTest
Tests moderation state node type integration.

Namespace

Drupal\Tests\workbench_moderation\Functional

Code

public function testNotModerated() {
  $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
    ->assertRaw('Save as unpublished');
  $this
    ->drupalPostForm(NULL, [
    'title[0][value]' => 'Test',
  ], t('Save and publish'));
  $this
    ->assertSession()
    ->pageTextContains('Not moderated Test has been created.');
}