protected function ThunderTestTrait::logWithRole in Thunder 6.2.x
Same name and namespace in other branches
- 8.5 tests/src/Traits/ThunderTestTrait.php \Drupal\Tests\thunder\Traits\ThunderTestTrait::logWithRole()
- 8.2 tests/src/Traits/ThunderTestTrait.php \Drupal\Tests\thunder\Traits\ThunderTestTrait::logWithRole()
- 8.3 tests/src/Traits/ThunderTestTrait.php \Drupal\Tests\thunder\Traits\ThunderTestTrait::logWithRole()
- 8.4 tests/src/Traits/ThunderTestTrait.php \Drupal\Tests\thunder\Traits\ThunderTestTrait::logWithRole()
- 6.0.x tests/src/Traits/ThunderTestTrait.php \Drupal\Tests\thunder\Traits\ThunderTestTrait::logWithRole()
- 6.1.x tests/src/Traits/ThunderTestTrait.php \Drupal\Tests\thunder\Traits\ThunderTestTrait::logWithRole()
LogIn with defined role assigned to user.
Parameters
string $role: Role name that will be assigned to user.
10 calls to ThunderTestTrait::logWithRole()
- AdminToolbarTest::testEmptyMenuEntriesAreGone in tests/
src/ Functional/ Integration/ AdminToolbarTest.php - Tests empty menu groups are gone with admin_toolbar_links_access_filter.
- ArticleSchedulerIntegration::testSchedulerAccess in tests/
src/ FunctionalJavascript/ ArticleSchedulerIntegration.php - Test Creation of Article.
- BreadcrumbTest::testBreadCrumbs in tests/
src/ Functional/ BreadcrumbTest.php - Tests breadcrumbs on node and administrative paths.
- ContentListTest::testSchedulerLocalTask in tests/
src/ Functional/ ContentListTest.php - Tests scheduler tab is in local tasks.
- ContentTranslationTest::testBasicContentTranslation in tests/
src/ Functional/ Integration/ ContentTranslationTest.php - Test that basic translation creation works.
File
- tests/
src/ Traits/ ThunderTestTrait.php, line 134
Class
- ThunderTestTrait
- Use this trait to reuse an existing database.
Namespace
Drupal\Tests\thunder\TraitsCode
protected function logWithRole($role) {
$editor = $this
->drupalCreateUser();
$editor
->addRole($role);
$editor
->save();
$this
->drupalLogin($editor);
return $editor;
}