Bugzilla – Attachment 158661 Details for
Bug 21431
Differentiate password change and password reset in action logs
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 21431: Add unit test
Bug-21431-Add-unit-test.patch (text/plain), 2.19 KB, created by
Martin Renvoize (ashimema)
on 2023-11-08 12:29:33 UTC
(
hide
)
Description:
Bug 21431: Add unit test
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2023-11-08 12:29:33 UTC
Size:
2.19 KB
patch
obsolete
>From 8f7b457dfc0c2ef12a24c9b0ac34dcd88572193c Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Thu, 2 Nov 2023 12:59:03 +0000 >Subject: [PATCH] Bug 21431: Add unit test > >Test plan: >Run t/db_dependent/Koha/Patrons.t > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > t/db_dependent/Koha/Patrons.t | 23 +++++++++++++++++++---- > 1 file changed, 19 insertions(+), 4 deletions(-) > >diff --git a/t/db_dependent/Koha/Patrons.t b/t/db_dependent/Koha/Patrons.t >index a9df49df554..85a1159fcda 100755 >--- a/t/db_dependent/Koha/Patrons.t >+++ b/t/db_dependent/Koha/Patrons.t >@@ -1921,7 +1921,7 @@ subtest '->store' => sub { > > subtest '->set_password' => sub { > >- plan tests => 16; >+ plan tests => 17; > > t::lib::Mocks::mock_preference( 'EmailFieldPrecedence', 'emailpro|email' ); > >@@ -1994,10 +1994,25 @@ subtest '->set_password' => sub { > > # Enable logging password changes > t::lib::Mocks::mock_preference( 'BorrowersLog', 1 ); >- $patron->set_password({ password => 'abcd b' }); >- >- $number_of_logs = $schema->resultset('ActionLog')->search( { module => 'MEMBERS', action => 'CHANGE PASS', object => $patron->borrowernumber } )->count; >+ $patron->set_password( { password => 'abcd b' } ); >+ $number_of_logs = $schema->resultset('ActionLog')->search( >+ { >+ module => 'MEMBERS', >+ action => 'CHANGE PASS', >+ object => $patron->borrowernumber >+ } >+ )->count; > is( $number_of_logs, 1, 'With BorrowerLogs, Koha::Patron->set_password does log password changes' ); >+ # add other action name >+ $patron->set_password( { password => 'abcd b2', action => 'RESET PASS' } ); >+ $number_of_logs = $schema->resultset('ActionLog')->search( >+ { >+ module => 'MEMBERS', >+ action => 'RESET PASS', >+ object => $patron->borrowernumber >+ } >+ )->count; >+ is( $number_of_logs, 1, 'set_password allows another action name' ); > > # Enable notifying patrons of password changes > t::lib::Mocks::mock_preference( 'NotifyPasswordChange', 1 ); >-- >2.41.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 21431
:
158256
|
158257
|
158258
|
158268
|
158269
|
158270
|
158660
| 158661 |
158662