Bug 18308: fix failing tests

#   Failed test 'check_password hook tests'
 #   at t/db_dependent/Koha/Plugins/Patron.t line 83.
 [The password was rejected by a plugin]# Looks like your test exited with 255 just after 5.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
This commit is contained in:
Jonathan Druart 2020-05-05 10:26:55 +02:00 committed by Martin Renvoize
parent 0575bc22d1
commit cd141a7445
No known key found for this signature in database
GPG Key ID: 422B469130441A0F
2 changed files with 2 additions and 2 deletions

View File

@ -69,7 +69,7 @@ subtest 'check_password hook tests' => sub {
throws_ok { $patron->store } 'Koha::Exceptions::Password::Plugin',
'Exception raised for adding patron with bad password';
$patron->password('1234');
$patron->password('12345678');
ok( $patron->store, 'Patron created with good password' );
t::lib::Mocks::mock_preference( 'RequireStrongPassword', '0' );

View File

@ -218,7 +218,7 @@ sub check_password {
my ( $self, $args ) = @_;
my $password = $args->{'password'};
if ( $password && $password =~ m/^\d\d\d\d$/ ) {
if ( $password && $password =~ m/^\d{8}$/ ) {
return { error => 0 };
}
else {