From 9c32b81ef90e1ee83f71fef17229bb0a475db96c Mon Sep 17 00:00:00 2001
From: Demian Katz <demian.katz@villanova.edu>
Date: Thu, 22 Oct 2015 13:43:31 -0400
Subject: [PATCH] Don't throw exceptions in teardown; it masks other problems.

---
 module/VuFind/src/VuFindTest/Unit/UserCreationTrait.php | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/module/VuFind/src/VuFindTest/Unit/UserCreationTrait.php b/module/VuFind/src/VuFindTest/Unit/UserCreationTrait.php
index b3f7d14d067..e05c65bcbf8 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
-- 
GitLab