Bugzilla – Attachment 132201 Details for
Bug 17748
Show due date in item search results
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 17748: (follow-up) Stronger unit tests
Bug-17748-follow-up-Stronger-unit-tests.patch (text/plain), 2.03 KB, created by
Fridolin Somers
on 2022-03-25 00:19:11 UTC
(
hide
)
Description:
Bug 17748: (follow-up) Stronger unit tests
Filename:
MIME Type:
Creator:
Fridolin Somers
Created:
2022-03-25 00:19:11 UTC
Size:
2.03 KB
patch
obsolete
>From feb9851202c0acd8ccbca2c6e227b92dcfb74ea3 Mon Sep 17 00:00:00 2001 >From: Fridolin Somers <fridolin.somers@biblibre.com> >Date: Thu, 24 Mar 2022 14:11:57 -1000 >Subject: [PATCH] Bug 17748: (follow-up) Stronger unit tests > >Before this patch, unit tests perform an item search assuming there is >no checked-out items in database. >This is correct for a fresh reseted database. >But if you checkout any item then prove t/db_dependent/Items.t it will >fail. >We can see in this file that other tests use filter on generated >branchcode. > >This patch adds filter to items.homebranch >--- > t/db_dependent/Items.t | 23 +++++++++++++++++++---- > 1 file changed, 19 insertions(+), 4 deletions(-) > >diff --git a/t/db_dependent/Items.t b/t/db_dependent/Items.t >index 5aa9260a48..ab0fa8e66e 100755 >--- a/t/db_dependent/Items.t >+++ b/t/db_dependent/Items.t >@@ -636,9 +636,19 @@ subtest 'SearchItems test' => sub { > AddIssue( $patron_borrower, $item1->barcode ); > # Search item where item is checked out > $filter = { >- field => 'onloan', >- query => 'not null', >- operator => 'is', >+ conjunction => 'AND', >+ filters => [ >+ { >+ field => 'onloan', >+ query => 'not null', >+ operator => 'is', >+ }, >+ { >+ field => 'homebranch', >+ query => $item1->homebranch, >+ operator => '=', >+ }, >+ ], > }; > ($items, $total_results) = SearchItems($filter); > ok(scalar @$items == 1, 'found 1 checked out item'); >@@ -648,7 +658,12 @@ subtest 'SearchItems test' => sub { > sortby => 'availability', > sortorder => 'DESC', > }; >- ($items, $total_results) = SearchItems(undef,$params); >+ $filter = { >+ field => 'homebranch', >+ query => $item1->homebranch, >+ operator => '=', >+ }; >+ ($items, $total_results) = SearchItems($filter,$params); > is($items->[0]->{barcode}, $item1->barcode, 'Items sorted as expected by availability'); > > $schema->storage->txn_rollback; >-- >2.35.1
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 17748
:
116353
|
119341
|
128332
|
128333
|
128582
|
128583
|
128584
|
128591
|
128638
|
128645
|
128646
|
128647
|
129623
|
129624
|
129625
|
130154
|
130845
|
130846
|
130847
|
130848
|
130849
|
131051
|
132016
| 132201