You are here

public function SocialDrupalContext::iEnableNicknameField in Open Social 8.9

Same name and namespace in other branches
  1. 8.5 tests/behat/features/bootstrap/SocialDrupalContext.php \Drupal\social\Behat\SocialDrupalContext::iEnableNicknameField()
  2. 8.6 tests/behat/features/bootstrap/SocialDrupalContext.php \Drupal\social\Behat\SocialDrupalContext::iEnableNicknameField()
  3. 8.7 tests/behat/features/bootstrap/SocialDrupalContext.php \Drupal\social\Behat\SocialDrupalContext::iEnableNicknameField()
  4. 8.8 tests/behat/features/bootstrap/SocialDrupalContext.php \Drupal\social\Behat\SocialDrupalContext::iEnableNicknameField()
  5. 10.3.x tests/behat/features/bootstrap/SocialDrupalContext.php \Drupal\social\Behat\SocialDrupalContext::iEnableNicknameField()
  6. 10.0.x tests/behat/features/bootstrap/SocialDrupalContext.php \Drupal\social\Behat\SocialDrupalContext::iEnableNicknameField()
  7. 10.1.x tests/behat/features/bootstrap/SocialDrupalContext.php \Drupal\social\Behat\SocialDrupalContext::iEnableNicknameField()
  8. 10.2.x tests/behat/features/bootstrap/SocialDrupalContext.php \Drupal\social\Behat\SocialDrupalContext::iEnableNicknameField()

I enable the nickname field on profiles

@When /^(?:|I )enable the nickname field on profiles/

File

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

Class

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

Namespace

Drupal\social\Behat

Code

public function iEnableNicknameField() {
  if (!\Drupal::service('module_handler')
    ->moduleExists("social_profile_fields")) {
    throw new \Exception("Could not enable nickname field for profile because the Social Profile Fields module is disabled.");
  }
  \Drupal::configFactory()
    ->getEditable('social_profile_fields.settings')
    ->set("profile_profile_field_profile_nick_name", TRUE)
    ->save();
}