From f7b4a2bb791b93ffc084910c4bf3855055a6fddd Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Thu, 26 Aug 2021 09:34:39 -0300 Subject: [PATCH] Bug 28906: Regression tests Signed-off-by: Tomas Cohen Arazi Signed-off-by: David Nind Signed-off-by: Martin Renvoize --- t/db_dependent/Koha/Items.t | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/t/db_dependent/Koha/Items.t b/t/db_dependent/Koha/Items.t index d743402b1a1..0d34f8f721d 100755 --- a/t/db_dependent/Koha/Items.t +++ b/t/db_dependent/Koha/Items.t @@ -1535,7 +1535,7 @@ $schema->storage->txn_rollback; subtest 'filter_by_visible_in_opac() tests' => sub { - plan tests => 12; + plan tests => 14; $schema->storage->txn_begin; @@ -1688,6 +1688,15 @@ subtest 'filter_by_visible_in_opac() tests' => sub { my @warnings = C4::Context->dbh->selectrow_array('SHOW WARNINGS'); is( $warnings[2], q{Truncated incorrect DOUBLE value: 'AB'}); + $rules = { itype => [ $itype_1->itemtype ], copynumber => [ 2 ] }; + my @items = $biblio->items->filter_by_visible_in_opac; + is( + scalar @items, + 2, + 'filter_by_visible_in_opac honours list context' + ); + is( ref($items[0]), 'Koha::Item', 'Returns a list of Koha::Item objects' ); + $schema->storage->txn_rollback; }; -- 2.20.1