You are here

protected function MetatagForumTest::setUp in Metatag 8

Setup basic environment.

Overrides BrowserTestBase::setUp

File

tests/src/Functional/MetatagForumTest.php, line 43

Class

MetatagForumTest
Ensures that meta tags are rendering correctly on forum pages.

Namespace

Drupal\Tests\metatag\Functional

Code

protected function setUp() {
  parent::setUp();
  $admin_permissions = [
    'administer nodes',
    'bypass node access',
    'administer meta tags',
    'administer site configuration',
    'access content',
  ];

  // Create and login user.
  $this->adminUser = $this
    ->drupalCreateUser($admin_permissions);
  $this
    ->drupalLogin($this->adminUser);

  // Create content type.
  $this
    ->drupalCreateContentType([
    'type' => 'page',
    'display_submitted' => FALSE,
  ]);
  $this->nodeId = $this
    ->drupalCreateNode([
    'title' => $this
      ->randomMachineName(8),
    'promote' => 1,
  ])
    ->id();
  $this
    ->config('system.site')
    ->set('page.front', '/node/' . $this->nodeId)
    ->save();
}