You are here

protected function ThunderTestTrait::logWithRole in Thunder 6.2.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.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.

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.

... See full list

File

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

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