You are here

protected function ThunderTestTrait::logWithRole in Thunder 6.0.x

Same name and namespace in other branches
  1. 8.5 tests/src/Traits/ThunderTestTrait.php \Drupal\Tests\thunder\Traits\ThunderTestTrait::logWithRole()
  2. 8.2 tests/src/Traits/ThunderTestTrait.php \Drupal\Tests\thunder\Traits\ThunderTestTrait::logWithRole()
  3. 8.3 tests/src/Traits/ThunderTestTrait.php \Drupal\Tests\thunder\Traits\ThunderTestTrait::logWithRole()
  4. 8.4 tests/src/Traits/ThunderTestTrait.php \Drupal\Tests\thunder\Traits\ThunderTestTrait::logWithRole()
  5. 6.2.x tests/src/Traits/ThunderTestTrait.php \Drupal\Tests\thunder\Traits\ThunderTestTrait::logWithRole()
  6. 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.
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.
FileRemoveButtonTest::testRemoveButtonGone in modules/thunder_media/tests/src/Functional/FileRemoveButtonTest.php
Test for transliteration of file name.

... See full list

File

tests/src/Traits/ThunderTestTrait.php, line 131

Class

ThunderTestTrait
Use this trait to reuse an existing database.

Namespace

Drupal\Tests\thunder\Traits

Code

protected function logWithRole($role) {
  $editor = $this
    ->drupalCreateUser();
  $editor
    ->addRole($role);
  $editor
    ->save();
  $this
    ->drupalLogin($editor);
  return $editor;
}