public function FeatureContext::cleanupUser in Open Social 10.3.x
Same name and namespace in other branches
- 10.0.x tests/behat/features/bootstrap/FeatureContext.php \Drupal\social\Behat\FeatureContext::cleanupUser()
- 10.1.x tests/behat/features/bootstrap/FeatureContext.php \Drupal\social\Behat\FeatureContext::cleanupUser()
- 10.2.x tests/behat/features/bootstrap/FeatureContext.php \Drupal\social\Behat\FeatureContext::cleanupUser()
Remove any groups that were created.
@AfterScenario
File
- tests/
behat/ features/ bootstrap/ FeatureContext.php, line 782
Class
- FeatureContext
- Defines application features from the specific context.
Namespace
Drupal\social\BehatCode
public function cleanupUser(AfterScenarioScope $scope) {
if (!empty($this->intended_user_names)) {
foreach ($this->intended_user_names as $name) {
$user_obj = user_load_by_name($name);
\Drupal::entityTypeManager()
->getStorage('user')
->load($user_obj
->id())
->delete();
}
}
}