Bugzilla – Attachment 77284 Details for
Bug 21087
Patron's password is hashed twice when the object is saved
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 21087: Test to describe the issue
Bug-21087-Test-to-describe-the-issue.patch (text/plain), 1.45 KB, created by
Kyle M Hall (khall)
on 2018-07-26 13:36:38 UTC
(
hide
)
Description:
Bug 21087: Test to describe the issue
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2018-07-26 13:36:38 UTC
Size:
1.45 KB
patch
obsolete
>From 096f8a8cf22f3dbfbf185e37ae8481473e9b8553 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Wed, 18 Jul 2018 19:14:40 -0300 >Subject: [PATCH] Bug 21087: Test to describe the issue > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> > >Signed-off-by: John Doe <you@example.com> >--- > t/db_dependent/Koha/Patrons.t | 10 +++++++++- > 1 file changed, 9 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Koha/Patrons.t b/t/db_dependent/Koha/Patrons.t >index 243f817d73..c102aaf4c2 100644 >--- a/t/db_dependent/Koha/Patrons.t >+++ b/t/db_dependent/Koha/Patrons.t >@@ -1427,7 +1427,7 @@ subtest 'Test Koha::Patrons::merge' => sub { > }; > > subtest '->store' => sub { >- plan tests => 1; >+ plan tests => 3; > my $schema = Koha::Database->new->schema; > $schema->storage->txn_begin; > >@@ -1442,6 +1442,14 @@ subtest '->store' => sub { > 'Koha::Exceptions::Object::DuplicateID', > 'Koha::Patron->store raises an exception on duplicate ID'; > >+ # Test password >+ my $password = 'password'; >+ $patron_1->password($password)->store; >+ like( $patron_1->password, qr|^\$2|, 'Password should be hashed using bcrypt (start with $2)' ); >+ my $digest = $patron_1->password; >+ $patron_1->surname('xxx')->store; >+ is( $patron_1->password, $digest, 'Password should not have changed on ->store'); >+ > $schema->storage->dbh->{PrintError} = $print_error; > $schema->storage->txn_rollback; > }; >-- >2.11.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 21087
:
77095
|
77096
|
77200
|
77201
|
77254
|
77255
|
77273
| 77284 |
77285
|
77286
|
77287
|
77288
|
77327