You are here

public function MetatagPageManagerTest::setUp in Metatag 8

Overrides BrowserTestBase::setUp

File

metatag_page_manager/tests/src/Functional/MetatagPageManagerTest.php, line 43

Class

MetatagPageManagerTest
Confirm the Page Manager integration works.

Namespace

Drupal\Tests\metatag_page_manager\Functional

Code

public function setUp() {
  parent::setUp();
  $this->assertSession = $this
    ->assertSession();
  Page::create([
    'id' => 'metatag_page_manager_test',
    'label' => 'Metatag Page',
    'path' => 'metatag-test',
  ])
    ->save();
  PageVariant::create([
    'id' => 'metatag_page_manager_variant_test',
    'variant' => 'block_display',
    'label' => 'Metatag Variant',
    'page' => 'metatag_page_manager_test',
    'weight' => 10,
  ])
    ->save();
  \Drupal::service("router.builder")
    ->rebuild();

  // Log in as user 1.
  $this
    ->loginUser1();
}