public function DemoUmamiProfileTest::testUser in Drupal 8
Same name and namespace in other branches
- 9 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);
}
}