diff --git a/module/VuFind/src/VuFindTest/Unit/UserCreationTrait.php b/module/VuFind/src/VuFindTest/Unit/UserCreationTrait.php index b3f7d14d067666b3d42f880d4c520638984e28d3..e05c65bcbf8fad5edbc41b322a1ed1c5f9d6b156 100644 --- a/module/VuFind/src/VuFindTest/Unit/UserCreationTrait.php +++ b/module/VuFind/src/VuFindTest/Unit/UserCreationTrait.php @@ -167,10 +167,9 @@ trait UserCreationTrait $userTable = $test->getTable('User'); foreach ((array)$users as $username) { $user = $userTable->getByUsername($username, false); - if (empty($user)) { - throw new \Exception("Problem deleting expected user ($username)."); + if (!empty($user)) { + $user->delete(); } - $user->delete(); } } } \ No newline at end of file