Bugzilla – Attachment 169411 Details for
Bug 37378
Patron searches can fail when library groups are set to 'Limit patron data access by group'
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 37378: Unit test
Bug-37378-Unit-test.patch (text/plain), 2.11 KB, created by
Nick Clemens (kidclamp)
on 2024-07-23 12:27:42 UTC
(
hide
)
Description:
Bug 37378: Unit test
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2024-07-23 12:27:42 UTC
Size:
2.11 KB
patch
obsolete
>From 08cfe07f288e75c77874ebcf8217f03dbda15d24 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Tue, 23 Jul 2024 12:12:17 +0000 >Subject: [PATCH] Bug 37378: Unit test > >--- > t/db_dependent/Koha/Patrons.t | 24 ++++++++++++++++++++++-- > 1 file changed, 22 insertions(+), 2 deletions(-) > >diff --git a/t/db_dependent/Koha/Patrons.t b/t/db_dependent/Koha/Patrons.t >index 68ea342a6e3..754b309d1b4 100755 >--- a/t/db_dependent/Koha/Patrons.t >+++ b/t/db_dependent/Koha/Patrons.t >@@ -1284,8 +1284,8 @@ subtest 'search_patrons_to_anonymise' => sub { > t::lib::Mocks::mock_preference('IndependentBranches', 0); > }; > >-subtest 'libraries_where_can_see_patrons + can_see_patron_infos + search_limited' => sub { >- plan tests => 3; >+subtest 'libraries_where_can_see_patrons + libraries_where_can_see_things + can_see_patron_infos + search_limited' => sub { >+ plan tests => 4; > > # group1 > # + library_11 >@@ -1329,6 +1329,26 @@ subtest 'libraries_where_can_see_patrons + can_see_patron_infos + search_limited > $sth->execute( $patron_21->borrowernumber, 'edit_borrowers' ); > > # Pfiou, we can start now! >+ subtest 'libraries_where_can_see_things' => sub { >+ plan tests => 2; >+ t::lib::Mocks::mock_userenv( { patron => $patron_11_2 } ); >+ my $params = { >+ permission => 'editcatalogue', >+ subpermission => 'edit_any_item', >+ group_feature => 'ft_limit_item_editing', >+ }; >+ my @branchcodes = $patron_11_2->libraries_where_can_see_things($params); >+ is_deeply( >+ \@branchcodes, [ sort ( $library_11->branchcode, $library_12->branchcode ) ], >+ q|patron_11_1 has view_borrower_infos_from_any_libraries => No restriction| >+ ); >+ @branchcodes = $patron_11_2->libraries_where_can_see_things($params); >+ is_deeply( >+ \@branchcodes, [ sort ( $library_11->branchcode, $library_12->branchcode ) ], >+ q|patron_11_1 has view_borrower_infos_from_any_libraries => No restriction| >+ ); >+ }; >+ > subtest 'libraries_where_can_see_patrons' => sub { > plan tests => 3; > >-- >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 37378
:
169411
|
169412
|
169413
|
169430
|
169431
|
169432
|
169711
|
169713
|
169714