Bugzilla – Attachment 111961 Details for
Bug 26032
Add 'is new' filter in items search
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 26032: Add unit test
0001-Bug-26032-Add-unit-test.patch (text/plain), 1.79 KB, created by
Emmi Takkinen
on 2020-10-19 11:11:01 UTC
(
hide
)
Description:
Bug 26032: Add unit test
Filename:
MIME Type:
Creator:
Emmi Takkinen
Created:
2020-10-19 11:11:01 UTC
Size:
1.79 KB
patch
obsolete
>From df58f291dbf97b16a473af032a69be1b87a73769 Mon Sep 17 00:00:00 2001 >From: Fridolin Somers <fridolin.somers@biblibre.com> >Date: Tue, 21 Jul 2020 12:26:55 +0200 >Subject: [PATCH 1/3] Bug 26032: Add unit test > >Run prove t/db_dependent/Items.t > >Signed-off-by: Emmi Takkinen <emmi.takkinen@outlook.com> >--- > t/db_dependent/Items.t | 25 ++++++++++++++++++++++++- > 1 file changed, 24 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Items.t b/t/db_dependent/Items.t >index 53ac9b8d93..4f94041643 100755 >--- a/t/db_dependent/Items.t >+++ b/t/db_dependent/Items.t >@@ -407,7 +407,7 @@ subtest q{Test Koha::Database->schema()->resultset('Item')->itemtype()} => sub { > }; > > subtest 'SearchItems test' => sub { >- plan tests => 15; >+ plan tests => 17; > > $schema->storage->txn_begin; > my $dbh = C4::Context->dbh; >@@ -605,6 +605,29 @@ subtest 'SearchItems test' => sub { > ($items, $total_results) = SearchItems($filter); > is($total_results, 1, "Search items.issues issues = 0 returns result (items.issues defaults to 0)"); > >+ # Is null >+ $filter = { >+ conjunction => 'AND', >+ filters => [ >+ { >+ field => 'new_status', >+ query => 0, >+ operator => '=' >+ }, >+ { >+ field => 'homebranch', >+ query => $library1->{branchcode}, >+ operator => '=', >+ }, >+ ], >+ }; >+ ($items, $total_results) = SearchItems($filter); >+ is($total_results, 0, 'found no item with new_status=0 without ifnull'); >+ >+ $filter->{filters}[0]->{ifnull} = 0; >+ ($items, $total_results) = SearchItems($filter); >+ is($total_results, 1, 'found all items of library1 with new_status=0 with ifnull = 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 26032
:
107141
|
107142
|
111554
|
111555
|
111834
|
111961
|
111962
|
111963
|
112500
|
112501
|
112502
|
112707
|
112708
|
112709
|
112710
|
112809
|
112810
|
112811
|
112812
|
112915
|
112916
|
112917
|
112918