Bugzilla – Attachment 141307 Details for
Bug 25936
Notify users if their password has changed
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 25936: (follow-up) Unit test for store
Bug-25936-follow-up-Unit-test-for-store.patch (text/plain), 2.39 KB, created by
Martin Renvoize (ashimema)
on 2022-10-04 13:17:30 UTC
(
hide
)
Description:
Bug 25936: (follow-up) Unit test for store
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2022-10-04 13:17:30 UTC
Size:
2.39 KB
patch
obsolete
>From ba6872a50ff8f9826656755ed7ef12e10efbec36 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Tue, 4 Oct 2022 12:01:47 +0100 >Subject: [PATCH] Bug 25936: (follow-up) Unit test for store > >This unit test confirms that we are not triggering the Password Change >notification notice upon patron creations. >--- > t/db_dependent/Koha/Patrons.t | 36 ++++++++++++++++++++++++++++++++++- > 1 file changed, 35 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Koha/Patrons.t b/t/db_dependent/Koha/Patrons.t >index ad8e7e58f7..627f0f9f4d 100755 >--- a/t/db_dependent/Koha/Patrons.t >+++ b/t/db_dependent/Koha/Patrons.t >@@ -1865,7 +1865,7 @@ subtest 'Test Koha::Patrons::merge' => sub { > }; > > subtest '->store' => sub { >- plan tests => 7; >+ plan tests => 8; > my $schema = Koha::Database->new->schema; > $schema->storage->txn_begin; > >@@ -1921,6 +1921,40 @@ subtest '->store' => sub { > is($logs->count, 0, '->store should not have generated a log for updated_on') or diag 'Log generated:'.Dumper($logs->unblessed); > $schema->storage->txn_rollback; > }; >+ >+ subtest 'create user usage' => sub { >+ plan tests => 1; >+ $schema->storage->txn_begin; >+ >+ my $library = $builder->build_object( { class => 'Koha::Libraries' } ); >+ my $patron_category = $builder->build_object( >+ { >+ class => 'Koha::Patron::Categories', >+ value => { category_type => 'P', enrolmentfee => 0 } >+ } >+ ); >+ my %data = ( >+ cardnumber => "123456789", >+ firstname => "Tômà sÃtó", >+ surname => "Ãoné", >+ password => 'Funk3y', >+ categorycode => $patron_category->categorycode, >+ branchcode => $library->branchcode, >+ ); >+ >+ # Enable notifying patrons of password changes for these tests >+ t::lib::Mocks::mock_preference( 'NotifyPasswordChange', 1 ); >+ my $new_patron = Koha::Patron->new( \%data )->store(); >+ my $queued_notices = Koha::Notice::Messages->search( >+ { borrowernumber => $new_patron->borrowernumber } >+ ); >+ is( >+ $queued_notices->count, 0, >+ "No notice queued when NotifyPasswordChange enabled and this is a new patron" >+ ); >+ >+ $schema->storage->txn_rollback; >+ }; > }; > > subtest '->set_password' => sub { >-- >2.20.1
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 25936
:
131316
|
131317
|
131318
|
131319
|
131519
|
131520
|
131521
|
131543
|
141080
|
141081
|
141082
|
141104
|
141105
|
141106
|
141107
|
141108
|
141306
| 141307