From c7299bc773cdd51950348a32eabeb42930c3c2f5 Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Fri, 14 Sep 2018 16:15:13 -0700 Subject: [PATCH] Bug 21178: (QA follow-up) whitespace characters fix Signed-off-by: Tomas Cohen Arazi Signed-off-by: Julian Maurice Signed-off-by: Tomas Cohen Arazi --- Koha/Patron.pm | 5 ++--- t/db_dependent/Koha/Patrons.t | 3 +-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/Koha/Patron.pm b/Koha/Patron.pm index c26eda041a..f9214a6eed 100644 --- a/Koha/Patron.pm +++ b/Koha/Patron.pm @@ -668,7 +668,7 @@ Exceptions are thrown if the password is not good enough. =item Koha::Exceptions::Password::TooShort -=item Koha::Exceptions::Password::TrailingWhitespaces +=item Koha::Exceptions::Password::WhitespaceCharacters =item Koha::Exceptions::Password::TooWeak @@ -691,8 +691,7 @@ sub set_password { { length => $password_length, min_length => $min_length } ); } elsif ( $error eq 'has_whitespaces' ) { - Koha::Exceptions::Password::TrailingWhitespaces->throw( - "Password contains trailing spaces, which is forbidden."); + Koha::Exceptions::Password::WhitespaceCharacters->throw(); } elsif ( $error eq 'too_weak' ) { Koha::Exceptions::Password::TooWeak->throw(); diff --git a/t/db_dependent/Koha/Patrons.t b/t/db_dependent/Koha/Patrons.t index f8c8a8046e..35fff0ff54 100644 --- a/t/db_dependent/Koha/Patrons.t +++ b/t/db_dependent/Koha/Patrons.t @@ -1500,7 +1500,6 @@ subtest '->store' => sub { $schema->storage->txn_rollback; }; - subtest '->set_password' => sub { plan tests => 11; @@ -1530,7 +1529,7 @@ subtest '->set_password' => sub { # Trailing spaces tests throws_ok { $patron->set_password('abcD12d '); } - 'Koha::Exceptions::Password::TrailingWhitespaces', + 'Koha::Exceptions::Password::WhitespaceCharacters', 'Password contains trailing spaces, exception is thrown'; # Require strong password tests -- 2.39.5