You are here

protected function ThunderTestTrait::logWithRole in Thunder 8.2

Same name and namespace in other branches
  1. 8.5 tests/src/Traits/ThunderTestTrait.php \Drupal\Tests\thunder\Traits\ThunderTestTrait::logWithRole()
  2. 8.3 tests/src/Traits/ThunderTestTrait.php \Drupal\Tests\thunder\Traits\ThunderTestTrait::logWithRole()
  3. 8.4 tests/src/Traits/ThunderTestTrait.php \Drupal\Tests\thunder\Traits\ThunderTestTrait::logWithRole()
  4. 6.2.x tests/src/Traits/ThunderTestTrait.php \Drupal\Tests\thunder\Traits\ThunderTestTrait::logWithRole()
  5. 6.0.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.

11 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.
FileRemoveButtonTest::testRemoveButtonGone in modules/thunder_media/tests/src/Functional/FileRemoveButtonTest.php
Test for transliteration of file name.
LiveblogTest::testWithPusher in tests/src/FunctionalJavascript/Integration/LiveblogTest.php
Testing of module integration.

... See full list

File

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

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;
}