function DemoUmamiProfileTest::testUser

Same name in other branches
  1. 9 core/profiles/demo_umami/tests/src/Functional/DemoUmamiProfileTest.php \Drupal\Tests\demo_umami\Functional\DemoUmamiProfileTest::testUser()
  2. 8.9.x core/profiles/demo_umami/tests/src/Functional/DemoUmamiProfileTest.php \Drupal\Tests\demo_umami\Functional\DemoUmamiProfileTest::testUser()
  3. 10 core/profiles/demo_umami/tests/src/Functional/DemoUmamiProfileTest.php \Drupal\Tests\demo_umami\Functional\DemoUmamiProfileTest::testUser()

Tests that the users can log in with the admin password entered at install.

1 call to DemoUmamiProfileTest::testUser()
DemoUmamiProfileTest::testDemoFeatures in core/profiles/demo_umami/tests/src/Functional/DemoUmamiProfileTest.php
Tests various capabilities of the demo profile.

File

core/profiles/demo_umami/tests/src/Functional/DemoUmamiProfileTest.php, line 148

Class

DemoUmamiProfileTest
Tests demo_umami profile.

Namespace

Drupal\Tests\demo_umami\Functional

Code

protected function testUser() : void {
    $password = $this->rootUser->pass_raw;
    $ids = \Drupal::entityQuery('user')->accessCheck(FALSE)
        ->condition('roles', [
        'author',
        'editor',
    ], 'IN')
        ->execute();
    $users = \Drupal::entityTypeManager()->getStorage('user')
        ->loadMultiple($ids);
    foreach ($users as $user) {
        $this->drupalLoginWithPassword($user, $password);
    }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.