View | Details | Raw Unified | Return to bug 21178
Collapse All | Expand All

(-)a/Koha/Patron.pm (-3 / +2 lines)
Lines 668-674 Exceptions are thrown if the password is not good enough. Link Here
668
668
669
=item Koha::Exceptions::Password::TooShort
669
=item Koha::Exceptions::Password::TooShort
670
670
671
=item Koha::Exceptions::Password::TrailingWhitespaces
671
=item Koha::Exceptions::Password::WhitespaceCharacters
672
672
673
=item Koha::Exceptions::Password::TooWeak
673
=item Koha::Exceptions::Password::TooWeak
674
674
Lines 691-698 sub set_password { Link Here
691
                { length => $password_length, min_length => $min_length } );
691
                { length => $password_length, min_length => $min_length } );
692
        }
692
        }
693
        elsif ( $error eq 'has_whitespaces' ) {
693
        elsif ( $error eq 'has_whitespaces' ) {
694
            Koha::Exceptions::Password::TrailingWhitespaces->throw(
694
            Koha::Exceptions::Password::WhitespaceCharacters->throw();
695
                "Password contains trailing spaces, which is forbidden.");
696
        }
695
        }
697
        elsif ( $error eq 'too_weak' ) {
696
        elsif ( $error eq 'too_weak' ) {
698
            Koha::Exceptions::Password::TooWeak->throw();
697
            Koha::Exceptions::Password::TooWeak->throw();
(-)a/t/db_dependent/Koha/Patrons.t (-3 / +1 lines)
Lines 1500-1506 subtest '->store' => sub { Link Here
1500
    $schema->storage->txn_rollback;
1500
    $schema->storage->txn_rollback;
1501
};
1501
};
1502
1502
1503
1504
subtest '->set_password' => sub {
1503
subtest '->set_password' => sub {
1505
1504
1506
    plan tests => 11;
1505
    plan tests => 11;
Lines 1530-1536 subtest '->set_password' => sub { Link Here
1530
1529
1531
    # Trailing spaces tests
1530
    # Trailing spaces tests
1532
    throws_ok { $patron->set_password('abcD12d   '); }
1531
    throws_ok { $patron->set_password('abcD12d   '); }
1533
        'Koha::Exceptions::Password::TrailingWhitespaces',
1532
        'Koha::Exceptions::Password::WhitespaceCharacters',
1534
        'Password contains trailing spaces, exception is thrown';
1533
        'Password contains trailing spaces, exception is thrown';
1535
1534
1536
    # Require strong password tests
1535
    # Require strong password tests
1537
- 

Return to bug 21178