You are here

public function SocialDrupalContext::bootstrapWithAdminUser in Open Social 8

Same name and namespace in other branches
  1. 8.2 tests/behat/features/bootstrap/SocialDrupalContext.php \SocialDrupalContext::bootstrapWithAdminUser()

@beforeScenario @api

File

tests/behat/features/bootstrap/SocialDrupalContext.php, line 19

Class

SocialDrupalContext
Provides pre-built step definitions for interacting with Open Social.

Code

public function bootstrapWithAdminUser(BeforeScenarioScope $scope) {
  $admin_user = user_load('1');
  $current_user = \Drupal::getContainer()
    ->get('current_user');
  $current_user
    ->setAccount($admin_user);
}