From cd141a74458f739ce74e627376b97ea72df0c0c6 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 5 May 2020 10:26:55 +0200 Subject: [PATCH] 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 --- t/db_dependent/Koha/Plugins/Patron.t | 2 +- t/lib/Koha/Plugin/Test.pm | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/t/db_dependent/Koha/Plugins/Patron.t b/t/db_dependent/Koha/Plugins/Patron.t index 319928d968..e0b98d946b 100644 --- a/t/db_dependent/Koha/Plugins/Patron.t +++ b/t/db_dependent/Koha/Plugins/Patron.t @@ -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' ); diff --git a/t/lib/Koha/Plugin/Test.pm b/t/lib/Koha/Plugin/Test.pm index 3c2896b726..39c2bfa364 100644 --- a/t/lib/Koha/Plugin/Test.pm +++ b/t/lib/Koha/Plugin/Test.pm @@ -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 { -- 2.39.5