From 81bb1b55c27c3dfcab5a04af3257d5e93bcc6177 Mon Sep 17 00:00:00 2001 From: Lucas Gass Date: Thu, 2 May 2019 01:39:50 +0000 Subject: [PATCH] Bug 22692: (RMaint Follow-up) fix tests Signed-off-by: Lucas Gass --- t/db_dependent/Auth.t | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/t/db_dependent/Auth.t b/t/db_dependent/Auth.t index e9bdf22ee9..068ba641d6 100644 --- a/t/db_dependent/Auth.t +++ b/t/db_dependent/Auth.t @@ -145,9 +145,12 @@ subtest 'checkpw lockout tests' => sub { my $library = $builder->build_object( { class => 'Koha::Libraries' } ); my $patron = $builder->build_object( { class => 'Koha::Patrons' } ); my $password = 'password'; + my $dbh = C4::Context->dbh; + my $sth = $dbh->prepare("UPDATE borrowers SET password = ? WHERE borrowernumber=?"); t::lib::Mocks::mock_preference( 'RequireStrongPassword', 0 ); t::lib::Mocks::mock_preference( 'FailedLoginAttempts', 1 ); - $patron->set_password({ password => $password }); + my $clave = hash_password( $password ); + $sth->execute( $clave, $patron->borrowernumber ); my ( $checkpw, undef, undef ) = checkpw( $dbh, $patron->cardnumber, $password, undef, undef, 1 ); ok( $checkpw, 'checkpw returns true with right password when logging in via cardnumber' ); -- 2.39.5