From cf591bdf807a227dec62bff06e37d8f1d9503f36 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. --- t/db_dependent/Koha/Plugins/Patron.t | 4 ++-- t/lib/Koha/Plugin/Test.pm | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/t/db_dependent/Koha/Plugins/Patron.t b/t/db_dependent/Koha/Plugins/Patron.t index 22bf9b2210..f0002feb45 100644 --- a/t/db_dependent/Koha/Plugins/Patron.t +++ b/t/db_dependent/Koha/Plugins/Patron.t @@ -69,13 +69,13 @@ 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' ); throws_ok { $patron->set_password({ password => 'explosion' }) } 'Koha::Exceptions::Password::Plugin', 'Exception raised for update patron password with bad string'; - ok( $patron->set_password({ password => '4321' }), 'Patron password updated with good string' ); + ok( $patron->set_password({ password => '87654321' }), 'Patron password updated with good string' ); ok( $patron->set_password({ password => 'explosion', skip_validation => 1}), 'Patron password updated via skip validation'); $schema->storage->txn_rollback; 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.20.1