function NavigationTopBarContentModerationTest::setUp

Sets the test up.

Overrides ModerationStateTestBase::setUp

File

core/modules/navigation/tests/src/Functional/NavigationTopBarContentModerationTest.php, line 41

Class

NavigationTopBarContentModerationTest
Tests the top bar behavior along with content moderation.

Namespace

Drupal\Tests\navigation\Functional

Code

protected function setUp() : void {
  parent::setUp();
  $this->adminUser
    ->addRole($this->drupalCreateRole([
    'access navigation',
  ]))
    ->save();
  $this->drupalLogin($this->adminUser);
  $this->createContentTypeFromUi('Moderated content', 'moderated_content', TRUE);
  $this->grantUserPermissionToCreateContentOfType($this->adminUser, 'moderated_content');
  $this->node = $this->drupalCreateNode([
    'type' => 'moderated_content',
    'moderation_state' => 'published',
  ]);
}

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