You are here

protected function ModerationSidebarTaxonomyTermTest::setUp in Moderation Sidebar 8

Overrides BrowserTestBase::setUp

File

tests/src/FunctionalJavascript/ModerationSidebarTaxonomyTermTest.php, line 46

Class

ModerationSidebarTaxonomyTermTest
Contains Moderation Sidebar integration tests.

Namespace

Drupal\Tests\moderation_sidebar\FunctionalJavascript

Code

protected function setUp() {
  parent::setUp();

  // Create a Content Type with moderation enabled.
  $this->vocabulary = $this
    ->createVocabulary();

  // Create a user who can use the Moderation Sidebar.
  $user = $this
    ->drupalCreateUser([
    'access toolbar',
    'use moderation sidebar',
    'administer themes',
    'access content',
    'create terms in ' . $this->vocabulary
      ->id(),
  ]);
  $this
    ->drupalLogin($user);

  // Enable admin theme for content forms.
  $edit = [
    'use_admin_theme' => TRUE,
  ];
  $this
    ->drupalPostForm('admin/appearance', $edit, 'Save configuration');
  drupal_flush_all_caches();
}