You are here

protected function MetatagFrontpageTest::setUp in Metatag 8

Setup basic environment.

Overrides BrowserTestBase::setUp

File

tests/src/Functional/MetatagFrontpageTest.php, line 44

Class

MetatagFrontpageTest
Ensures that meta tags are rendering correctly on home page.

Namespace

Drupal\Tests\metatag\Functional

Code

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

  // Login user 1.
  $this
    ->loginUser1();

  // 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();
}