public function FeatureContext::deleteUserConsentEntities in Open Social 10.3.x
Same name and namespace in other branches
- 10.2.x tests/behat/features/bootstrap/FeatureContext.php \Drupal\social\Behat\FeatureContext::deleteUserConsentEntities()
Remove any user consents that were created.
@AfterScenario @data-policy-create
File
- tests/
behat/ features/ bootstrap/ FeatureContext.php, line 1160
Class
- FeatureContext
- Defines application features from the specific context.
Namespace
Drupal\social\BehatCode
public function deleteUserConsentEntities() {
$consents = \Drupal::entityTypeManager()
->getStorage('user_consent')
->loadMultiple();
foreach ($consents as $consent) {
try {
$consent
->delete();
} catch (\Throwable $e) {
// This can be fine.
}
}
}