Bugzilla – Attachment 97560 Details for
Bug 24443
Consider NULL as 0 for issues in items search
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 24443: Unit test
Bug-24443-Unit-test.patch (text/plain), 1.89 KB, created by
Maryse Simard
on 2020-01-17 19:53:37 UTC
(
hide
)
Description:
Bug 24443: Unit test
Filename:
MIME Type:
Creator:
Maryse Simard
Created:
2020-01-17 19:53:37 UTC
Size:
1.89 KB
patch
obsolete
>From 99be38b9dfa826a98daf282bf8fe34cd4c7e9d61 Mon Sep 17 00:00:00 2001 >From: Fridolin Somers <fridolin.somers@biblibre.com> >Date: Fri, 17 Jan 2020 10:48:50 +0100 >Subject: [PATCH] Bug 24443: Unit test > >Signed-off-by: Maryse Simard <maryse.simard@inlibro.com> >--- > t/db_dependent/Items.t | 22 +++++++++++++++++++++- > 1 file changed, 21 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Items.t b/t/db_dependent/Items.t >index 8ac9e7ef22..7d71b4e655 100755 >--- a/t/db_dependent/Items.t >+++ b/t/db_dependent/Items.t >@@ -368,7 +368,7 @@ subtest q{Test Koha::Database->schema()->resultset('Item')->itemtype()} => sub { > }; > > subtest 'SearchItems test' => sub { >- plan tests => 14; >+ plan tests => 15; > > $schema->storage->txn_begin; > my $dbh = C4::Context->dbh; >@@ -402,6 +402,7 @@ subtest 'SearchItems test' => sub { > homebranch => $library2->{branchcode}, > holdingbranch => $library2->{branchcode}, > itype => $itemtype->{itemtype}, >+ issues => 3, > }, $biblio->biblionumber); > > my ($items, $total_results); >@@ -543,6 +544,25 @@ subtest 'SearchItems test' => sub { > my $cpl_items_after = SearchItemsByField( 'homebranch', $library1->{branchcode}); > is( ( scalar( @$cpl_items_after ) - scalar ( @$cpl_items_before ) ), 1, 'SearchItemsByField should return something' ); > >+ # Issues count may be NULL >+ $filter = { >+ conjunction => 'AND', >+ filters => [ >+ { >+ field => 'issues', >+ query => 0, >+ operator => '=', >+ }, >+ { >+ field => 'homebranch', >+ query => $library1->{branchcode}, >+ operator => '=', >+ }, >+ ], >+ }; >+ ($items, $total_results) = SearchItems($filter); >+ is($total_results, 1, "Search items.issues is NULL with filter issues = 0"); >+ > $schema->storage->txn_rollback; > }; > >-- >2.17.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 24443
:
97480
|
97481
|
97482
|
97483
|
97486
|
97487
|
97488
|
97493
|
97496
|
97559
|
97560
|
97801
|
97802