Bugzilla – Attachment 165571 Details for
Bug 36508
Patron userid field can be overwritten by update_patron_categories when limiting by fines
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 36508: Unit tests
Bug-36508-Unit-tests.patch (text/plain), 1.88 KB, created by
Nick Clemens (kidclamp)
on 2024-04-25 16:26:56 UTC
(
hide
)
Description:
Bug 36508: Unit tests
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2024-04-25 16:26:56 UTC
Size:
1.88 KB
patch
obsolete
>From a9749d1b59c39b4fd4af142d61325719d8449be2 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Thu, 25 Apr 2024 16:20:53 +0000 >Subject: [PATCH] Bug 36508: Unit tests > >--- > t/db_dependent/Patrons.t | 15 ++++++++++++++- > 1 file changed, 14 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Patrons.t b/t/db_dependent/Patrons.t >index 2b9091802fe..2d93fa7831b 100755 >--- a/t/db_dependent/Patrons.t >+++ b/t/db_dependent/Patrons.t >@@ -106,7 +106,7 @@ foreach my $b ( $patrons->as_list() ) { > } > > subtest "Update patron categories" => sub { >- plan tests => 26; >+ plan tests => 29; > t::lib::Mocks::mock_preference( 'borrowerRelationship', 'test' ); > my $c_categorycode = $builder->build({ source => 'Category', value => { > category_type=>'C', >@@ -212,6 +212,19 @@ subtest "Update patron categories" => sub { > is( Koha::Patrons->search_patrons_to_update_category({from=>$p_categorycode})->update_category_to({category=>$a_categorycode}),1,'One professional patron updated to adult category'); > is( Koha::Patrons->find($inst->borrowernumber)->guarantee_relationships->guarantees->count,0,'Guarantee was removed when made adult'); > >+ is( >+ Koha::Patrons->search_patrons_to_update_category( { from => $a_categorycode, fine_max => 5 } ) >+ ->search( { "me.borrowernumber" => $adult1->borrowernumber } )->next->borrowernumber, >+ $adult1->borrowernumber, 'Expected patron is in the list of patrons to update' >+ ); >+ my $userid_before = $adult1->userid; >+ ok( >+ Koha::Patrons->search_patrons_to_update_category( { from => $a_categorycode, fine_max => 5 } ) >+ ->update_category_to( { category => $a_categorycode_2 } ), >+ 'Update of patrons is successful including adult1' >+ ); >+ $adult1->discard_changes; >+ is( $adult1->userid, $userid_before, "Patron userid not changed by updated" ); > }; > > >-- >2.39.2
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 36508
:
164391
|
165571
|
165572
|
165574
|
165575
|
165784
|
165785