mirror of
https://github.com/antonioribeiro/google2fa.git
synced 2026-04-26 16:45:49 +03:00
[PR #121] [MERGED] Made all exceptions inherit from a base exception #395
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/google2fa#395
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/antonioribeiro/google2fa/pull/121
Author: @poisa
Created: 6/22/2019
Status: ✅ Merged
Merged: 6/24/2019
Merged by: @antonioribeiro
Base:
master← Head:new-base-exception📝 Commits (2)
e3e0d42Made all exceptions inherit from a base exception513060bMade exceptions implement an interface instead of inheriting from a base exception📊 Changes
5 files changed (+35 additions, -31 deletions)
View changed files
➕
src/Exceptions/Google2FAExceptionInterface.php(+8 -0)📝
src/Exceptions/IncompatibleWithGoogleAuthenticatorException.php(+1 -1)📝
src/Exceptions/InvalidCharactersException.php(+1 -1)📝
src/Exceptions/SecretKeyTooShortException.php(+1 -1)📝
tests/Google2FATest.php(+24 -28)📄 Description
Implements changes proposed in #115.
Changes in tests:
Unit tests used the
@expectedExceptionto test for exceptions. There is nothing wrong with this approach except that we now want to test two things:Google2FAExceptionIn order to achieve both, I wrapped the test calls in a try/catch block which catches with the generalized exception, and then checks for the specific exception.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.