Improved code coverage for events and reports.

This commit is contained in:
James Cole
2018-08-24 16:07:33 +02:00
parent 2b54363dd7
commit 850a0ae17e
14 changed files with 566 additions and 101 deletions

View File

@@ -141,12 +141,10 @@ class UserEventHandler
$uri = route('profile.confirm-email-change', [$token->data]);
try {
Mail::to($newEmail)->send(new ConfirmEmailChangeMail($newEmail, $oldEmail, $uri, $ipAddress));
// @codeCoverageIgnoreStart
} catch (Exception $e) {
Log::error($e->getMessage());
}
// @codeCoverageIgnoreEnd
return true;
}
@@ -167,12 +165,10 @@ class UserEventHandler
$uri = route('profile.undo-email-change', [$token->data, hash('sha256', $oldEmail)]);
try {
Mail::to($oldEmail)->send(new UndoEmailChangeMail($newEmail, $oldEmail, $uri, $ipAddress));
// @codeCoverageIgnoreStart
} catch (Exception $e) {
Log::error($e->getMessage());
}
// @codeCoverageIgnoreEnd
return true;
}
@@ -194,13 +190,10 @@ class UserEventHandler
// send email.
try {
Mail::to($email)->send(new RequestedNewPasswordMail($url, $ipAddress));
// @codeCoverageIgnoreStart
} catch (Exception $e) {
Log::error($e->getMessage());
}
// @codeCoverageIgnoreEnd
return true;
}
@@ -224,11 +217,9 @@ class UserEventHandler
// send email.
try {
Mail::to($email)->send(new RegisteredUserMail($uri, $ipAddress));
// @codeCoverageIgnoreStart
} catch (Exception $e) {
Log::error($e->getMessage());
}
// @codeCoverageIgnoreEnd
}
return true;