function DemoUmamiProfileTest::testUser
Same name in other branches
- 9 core/profiles/demo_umami/tests/src/Functional/DemoUmamiProfileTest.php \Drupal\Tests\demo_umami\Functional\DemoUmamiProfileTest::testUser()
- 10 core/profiles/demo_umami/tests/src/Functional/DemoUmamiProfileTest.php \Drupal\Tests\demo_umami\Functional\DemoUmamiProfileTest::testUser()
- 11.x 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 selected at install.
File
-
core/
profiles/ demo_umami/ tests/ src/ Functional/ DemoUmamiProfileTest.php, line 96
Class
- DemoUmamiProfileTest
- Tests demo_umami profile.
Namespace
Drupal\Tests\demo_umami\FunctionalCode
public function testUser() {
$password = $this->rootUser->pass_raw;
$ids = \Drupal::entityQuery('user')->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.