From df6bb303a5e6f60881c5ff6120cb9638d8729022 Mon Sep 17 00:00:00 2001 From: Marc Galang Date: Fri, 7 Aug 2020 11:28:09 +0300 Subject: [PATCH] Do not fail tests when user entity cleanup fails --- src/Codeception/Module/DrupalUser.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Codeception/Module/DrupalUser.php b/src/Codeception/Module/DrupalUser.php index 5c0ea56..b246f7f 100644 --- a/src/Codeception/Module/DrupalUser.php +++ b/src/Codeception/Module/DrupalUser.php @@ -174,7 +174,11 @@ private function userCleanup() { /** @var \Drupal\user\Entity\User $user */ foreach ($users as $user) { $this->deleteUsersContent($user->id()); - $user->delete(); + try { + $user->delete(); + } catch (\Exception $e) { + continue; + } } } }