Bugzilla – Attachment 188636 Details for
Bug 18148
Make list of lists in OPAC sortable
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 18148: Add unit tests
Bug-18148-Add-unit-tests.patch (text/plain), 3.19 KB, created by
Laura Escamilla
on 2025-10-30 12:44:56 UTC
(
hide
)
Description:
Bug 18148: Add unit tests
Filename:
MIME Type:
Creator:
Laura Escamilla
Created:
2025-10-30 12:44:56 UTC
Size:
3.19 KB
patch
obsolete
>From b85fc438f3d4dbf3d74cf5a9af7d92101f0826e8 Mon Sep 17 00:00:00 2001 >From: David Cook <dcook@prosentient.com.au> >Date: Mon, 27 Oct 2025 05:36:47 +0000 >Subject: [PATCH] Bug 18148: Add unit tests > >Signed-off-by: Owen Leonard <oleonard@myacpl.org> >Signed-off-by: Laura_Escamilla <laura.escamilla@bywatersolutions.com> >--- > t/db_dependent/Virtualshelves.t | 39 ++++++++++++++++++++++++++++++++- > 1 file changed, 38 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Virtualshelves.t b/t/db_dependent/Virtualshelves.t >index 6c1aeba26f..7f77bcf926 100755 >--- a/t/db_dependent/Virtualshelves.t >+++ b/t/db_dependent/Virtualshelves.t >@@ -1233,7 +1233,7 @@ subtest 'Shelf permissions' => sub { > }; > > subtest 'Get shelves' => sub { >- plan tests => 5; >+ plan tests => 13; > my $patron1 = $builder->build( > { > source => 'Borrower', >@@ -1300,8 +1300,45 @@ subtest 'Get shelves' => sub { > 'get_private_shelves should return all shelves for a given patron, even the shared ones' > ); > >+ my $private_shelves_all = $private_shelves->as_list; >+ is( >+ $private_shelves_all->[0]->shelfname, 'private shelf 1 for patron 1', >+ 'First private shelf sorted correctly by default' >+ ); >+ is( $private_shelves_all->[-1]->shelfname, 'shared shelf', 'Last private shelf sorted correctly by default' ); >+ >+ my $private_shelves_sort_desc = Koha::Virtualshelves->get_private_shelves( >+ { borrowernumber => $patron1->{borrowernumber}, sort_by => { sortfield => 'shelfname', direction => 'desc' } } >+ ); >+ my $private_shelves_sort_desc_all = $private_shelves_sort_desc->as_list; >+ is( >+ $private_shelves_sort_desc_all->[0]->shelfname, 'shared shelf', >+ 'First private shelf sorted correctly by explicit desc name sort' >+ ); >+ is( >+ $private_shelves_sort_desc_all->[-1]->shelfname, 'private shelf 1 for patron 1', >+ 'Last private shelf sorted correctly by explicit desc name sort' >+ ); >+ > my $public_shelves = Koha::Virtualshelves->get_public_shelves; > is( $public_shelves->count, 2, 'get_public_shelves should return all public shelves, no matter who is the owner' ); >+ my $public_shelves_all = $public_shelves->as_list; >+ is( $public_shelves_all->[0]->shelfname, 'public shelf 1 for patron 1', 'First shelf sorted correctly by default' ); >+ is( >+ $public_shelves_all->[1]->shelfname, 'public shelf 2 for patron 1', >+ 'Second shelf sorted correctly by default' >+ ); >+ my $public_shelves_sort_desc = >+ Koha::Virtualshelves->get_public_shelves( { sort_by => { sortfield => 'shelfname', direction => 'desc' } } ); >+ my $public_shelves_sort_desc_all = $public_shelves_sort_desc->as_list; >+ is( >+ $public_shelves_sort_desc_all->[0]->shelfname, 'public shelf 2 for patron 1', >+ 'First shelf sorted correctly by explicit desc name sort' >+ ); >+ is( >+ $public_shelves_sort_desc_all->[1]->shelfname, 'public shelf 1 for patron 1', >+ 'Second shelf sorted correctly by explicit desc name sort' >+ ); > > my $shared_shelf = eval { $shelf_to_share->share("valid key") }; > my $shared_shelves = Koha::Virtualshelfshares->search( { borrowernumber => $patron1->{borrowernumber} } ); >-- >2.39.5
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 18148
:
188459
|
188460
|
188470
|
188471
|
188635
| 188636