Bugzilla – Attachment 106341 Details for
Bug 25875
Patron displayed multiple times in add user search if they have multiple sub permissions
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 25875: Unit test
Bug-25875-Unit-test.patch (text/plain), 2.12 KB, created by
Nick Clemens
on 2020-06-26 14:51:40 UTC
(
hide
)
Description:
Bug 25875: Unit test
Filename:
MIME Type:
Creator:
Nick Clemens
Created:
2020-06-26 14:51:40 UTC
Size:
2.12 KB
patch
obsolete
>From c0b2e3c6879f8088ce47a1645a5de347caa9d414 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Thu, 25 Jun 2020 10:38:16 +0000 >Subject: [PATCH] Bug 25875: Unit test > >--- > t/db_dependent/Utils/Datatables_Members.t | 35 ++++++++++++++++++++++++++++++- > 1 file changed, 34 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Utils/Datatables_Members.t b/t/db_dependent/Utils/Datatables_Members.t >index e0632c4a2f..25128d8864 100644 >--- a/t/db_dependent/Utils/Datatables_Members.t >+++ b/t/db_dependent/Utils/Datatables_Members.t >@@ -501,7 +501,7 @@ subtest 'Search by any borrowers field (bug 17374)' => sub { > }; > > subtest 'Search with permissions' => sub { >- plan tests => 2; >+ plan tests => 4; > > my $superlibrarian = $builder->build_object( > { >@@ -549,6 +549,39 @@ subtest 'Search with permissions' => sub { > ], > 'We got the 3 patrons we expected' > ); >+ >+ C4::Context->dbh->do( >+ q|INSERT INTO user_permissions(borrowernumber, module_bit, code) VALUES(?,?,?)|, >+ undef, >+ $librarian_with_subpermission->borrowernumber, >+ 13, >+ 'moderate_comments' >+ ); >+ $search_results = C4::Utils::DataTables::Members::search( >+ { >+ searchmember => "", >+ searchfieldstype => 'standard', >+ searchtype => 'contain', >+ branchcode => $branchcode, >+ has_permission => { >+ permission => 'suggestions', >+ subpermission => 'suggestions_manage' >+ }, >+ dt_params => { iDisplayLength => 3, iDisplayStart => 0 }, >+ } >+ ); >+ is( $search_results->{iTotalDisplayRecords}, >+ 3, "We find 3 patrons with suggestions_manage permission" ); >+ is_deeply( >+ [ sort map { $_->{borrowernumber} } @{ $search_results->{patrons} } ], >+ [ >+ $superlibrarian->borrowernumber, >+ $librarian_with_full_permission->borrowernumber, >+ $librarian_with_subpermission->borrowernumber >+ ], >+ 'We got the 3 patrons we expected' >+ ); >+ > }; > > subtest 'return values' => sub { >-- >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 25875
:
106283
|
106284
|
106285
|
106286
|
106341
|
106363
|
106364