Revert "Bug 17494: (QA followup) Fix exception name"

This reverts commit 9a30183671.
This commit is contained in:
Mason James 2016-12-29 14:42:58 +13:00
parent cf6deef8b1
commit 7ac313cbcd
3 changed files with 6 additions and 13 deletions

View File

@ -43,9 +43,7 @@ sub store {
if ( $self->verification_token ) {
if ( Koha::Patron::Modifications->search( { verification_token => $self->verification_token } )->count() ) {
Koha::Exceptions::Patron::Modification::DuplicateVerificationToken->throw(
"Duplicate verification token " . $self->verification_token
);
Koha::Exceptions::Koha::Patron::Modification::DuplicateVerificationToken->throw;
}
}

View File

@ -3,14 +3,10 @@ package Koha::Exceptions::Patron::Modification;
use Modern::Perl;
use Exception::Class (
'Koha::Exceptions::Patron::Modification' => {
description => 'Something went wrong'
'Koha::Exceptions::Koha::Patron::Modification::DuplicateVerificationToken' => {
isa => 'Koha::Exceptions::Object',
description => "The verification token given already exists",
},
'Koha::Exceptions::Patron::Modification::DuplicateVerificationToken' => {
isa => 'Koha::Exceptions::Patron::Modification',
description => "The verification token given already exists"
}
);
1;

View File

@ -1,7 +1,7 @@
#!/usr/bin/perl
use Modern::Perl;
use Test::More tests => 16;
use Test::More tests => 15;
use Try::Tiny;
use t::lib::TestBuilder;
@ -31,9 +31,8 @@ try {
}
)->store();
} catch {
ok( $_->isa('Koha::Exceptions::Patron::Modification::DuplicateVerificationToken'),
ok( $_->isa('Koha::Exceptions::Koha::Patron::Modification::DuplicateVerificationToken'),
'Attempting to add a duplicate verification token to the database should raise a Koha::Exceptions::Koha::Patron::Modification::DuplicateVerificationToken exception' );
is( $_->message, "Duplicate verification token 1234567890", 'Exception carries the right message' );
};
## Get the new pending modification