You are here

protected function MetatagHelperTrait::loginUser1 in Metatag 8

Log in as user 1.

10 calls to MetatagHelperTrait::loginUser1()
DefaultTags::testUser in tests/src/Functional/DefaultTags.php
Test the default values for a User entity.
MetatagAdminTest::testListPager in tests/src/Functional/MetatagAdminTest.php
Test that metatag list page pager works as expected.
MetatagFrontpageTest::setUp in tests/src/Functional/MetatagFrontpageTest.php
Setup basic environment.
MetatagPageManagerTest::setUp in metatag_page_manager/tests/src/Functional/MetatagPageManagerTest.php
MetatagPageManagerTest::testMultipleVariantPage in metatag_page_manager/tests/src/Functional/MetatagPageManagerTest.php
Tests a multi-variant page.

... See full list

File

tests/src/Functional/MetatagHelperTrait.php, line 19

Class

MetatagHelperTrait
Misc helper functions for the automated tests.

Namespace

Drupal\Tests\metatag\Functional

Code

protected function loginUser1() {

  // Load user 1.

  /* @var \Drupal\user\Entity\User $account */
  $account = User::load(1);

  // Reset the password.
  $password = 'foo';
  $account
    ->setPassword($password)
    ->save();

  // Support old and new tests.
  $account->passRaw = $password;
  $account->pass_raw = $password;

  // Login.
  $this
    ->drupalLogin($account);
}