Skip to content
Snippets Groups Projects
Commit 2668b189 authored by Demian Katz's avatar Demian Katz
Browse files

Began refactoring code to be more generic.

parent c03960ff
No related merge requests found
...@@ -372,20 +372,19 @@ class FavoritesTest extends \VuFindTest\Unit\MinkTestCase ...@@ -372,20 +372,19 @@ class FavoritesTest extends \VuFindTest\Unit\MinkTestCase
public static function tearDownAfterClass() public static function tearDownAfterClass()
{ {
// If CI is not running, all tests were skipped, so no work is necessary: // If CI is not running, all tests were skipped, so no work is necessary:
$test = new FavoritesTest(); $test = new static(); // create instance of current class
if (!$test->continuousIntegrationRunning()) { if (!$test->continuousIntegrationRunning()) {
return; return;
} }
// Delete test user // Delete test user
$test = new FavoritesTest();
$userTable = $test->getTable('User'); $userTable = $test->getTable('User');
$user = $userTable->getByUsername(self::$hash, false); foreach ([self::$hash, self::$hash2] as $username) {
$user2 = $userTable->getByUsername(self::$hash2, false); $user = $userTable->getByUsername($username, false);
if (empty($user) || empty($user2)) { if (empty($user)) {
throw new \Exception('Problem deleting expected user.'); throw new \Exception('Problem deleting expected user.');
}
$user->delete();
} }
$user->delete();
$user2->delete();
} }
} }
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment