Bugzilla – Attachment 174793 Details for
Bug 14907
Item search: call numbers in Item search results are ordered alphabetically
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 14907: Unit tests
Bug-14907-Unit-tests.patch (text/plain), 2.06 KB, created by
Nick Clemens (kidclamp)
on 2024-11-19 15:42:09 UTC
(
hide
)
Description:
Bug 14907: Unit tests
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2024-11-19 15:42:09 UTC
Size:
2.06 KB
patch
obsolete
>From b53c732de44a054d74b27f250db8979a8723997f Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Tue, 19 Nov 2024 14:48:54 +0000 >Subject: [PATCH] Bug 14907: Unit tests > >--- > t/db_dependent/Items.t | 33 ++++++++++++++++++++++++++++++++- > 1 file changed, 32 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Items.t b/t/db_dependent/Items.t >index db90d09439a..1954162a0af 100755 >--- a/t/db_dependent/Items.t >+++ b/t/db_dependent/Items.t >@@ -283,7 +283,7 @@ subtest q{Test Koha::Database->schema()->resultset('Item')->itemtype()} => sub { > }; > > subtest 'SearchItems test' => sub { >- plan tests => 20; >+ plan tests => 21; > > $schema->storage->txn_begin; > my $dbh = C4::Context->dbh; >@@ -539,6 +539,37 @@ subtest 'SearchItems test' => sub { > ($items, $total_results) = SearchItems($filter,$params); > is($items->[0]->{barcode}, $item1->barcode, 'Items sorted as expected by availability'); > >+ subtest 'Sort items by callnumber' => sub { >+ plan tests => 2; >+ >+ # Add two items >+ my $item1 = $builder->build_sample_item( >+ { >+ itemcallnumber => 'D102.D3 1930', >+ cn_source => 'lcc' >+ } >+ ); >+ my $item2 = $builder->build_sample_item( >+ { >+ library => $item1->homebranch, >+ itemcallnumber => 'D1015.B4 1965', >+ cn_source => 'lcc' >+ } >+ ); >+ my $filter = { >+ field => 'homebranch', >+ query => $item1->homebranch, >+ operator => '=', >+ }; >+ my $params = { >+ sortby => 'itemcallnumber', >+ sortorder => 'DESC', >+ }; >+ ( $items, $total_results ) = SearchItems( $filter, $params ); >+ is( $items->[0]->{barcode}, $item2->barcode, 'Items sorted by cn_sort correctly' ); >+ is( $items->[1]->{barcode}, $item1->barcode, 'Items sorted by cn_sort correctly' ); >+ }; >+ > subtest 'Search items by ISSN and ISBN with variations' => sub { > plan tests => 4; > >-- >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 14907
:
174793
|
174794
|
174861
|
174862
|
174990
|
176308
|
176309