From ec49e7d83bcbfa16dca9f05c36e600ba5c02a2ee Mon Sep 17 00:00:00 2001 From: Julian Maurice Date: Fri, 5 Oct 2018 17:18:57 +0200 Subject: [PATCH] Bug 21178: (QA follow-up) Add a test to verify that the hash is correct Signed-off-by: Julian Maurice Signed-off-by: Tomas Cohen Arazi --- t/db_dependent/Koha/Patrons.t | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/t/db_dependent/Koha/Patrons.t b/t/db_dependent/Koha/Patrons.t index 35fff0ff54..61e552c31c 100644 --- a/t/db_dependent/Koha/Patrons.t +++ b/t/db_dependent/Koha/Patrons.t @@ -28,6 +28,7 @@ use JSON; use C4::Circulation; use C4::Biblio; +use C4::Auth qw(checkpw_hash); use Koha::Holds; use Koha::Patrons; @@ -1502,7 +1503,7 @@ subtest '->store' => sub { subtest '->set_password' => sub { - plan tests => 11; + plan tests => 12; $schema->storage->txn_begin; @@ -1555,6 +1556,7 @@ subtest '->set_password' => sub { $patron->discard_changes; isnt( $patron->password, $old_digest, 'Password has been updated' ); + ok( checkpw_hash('abcd a', $patron->password), 'Password hash is correct' ); is( $patron->login_attempts, 0, 'Login attemps have been reset' ); my $number_of_logs = $schema->resultset('ActionLog')->search( { module => 'MEMBERS', action => 'CHANGE PASS', object => $patron->borrowernumber } )->count; -- 2.20.1