Bugzilla – Attachment 112809 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
Bug-26032-Add-unit-test.patch (text/plain), 1.93 KB, created by
Katrin Fischer
on 2020-11-01 13:55:18 UTC
(
hide
)
Description:
Bug 26032: Add unit test
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2020-11-01 13:55:18 UTC
Size:
1.93 KB
patch
obsolete
>From 38a6bb43e8ef24417b68f8d362a0ec78ba324358 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] Bug 26032: Add unit test >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >Run prove t/db_dependent/Items.t > >Signed-off-by: Emmi Takkinen <emmi.takkinen@outlook.com> >Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr> >--- > 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.11.0
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