From e6e3c2a485d4e61e08c2e7b789ffc6b2a17401d6 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Thu, 22 Jan 2026 15:31:47 +0100 Subject: [PATCH] Bug 41602: Add a test Signed-off-by: David Nind --- t/db_dependent/Koha/Items.t | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/t/db_dependent/Koha/Items.t b/t/db_dependent/Koha/Items.t index 6d230a7e14..b670489d32 100755 --- a/t/db_dependent/Koha/Items.t +++ b/t/db_dependent/Koha/Items.t @@ -75,7 +75,7 @@ is( $retrieved_item_1->barcode, $new_item_1->barcode, 'Find a item by id should subtest 'search' => sub { - plan tests => 15; + plan tests => 16; $schema->storage->txn_begin; my $patron = $builder->build_object( { class => 'Koha::Patrons' } ); @@ -96,8 +96,12 @@ subtest 'search' => sub { biblionumber => $biblio->biblionumber, } ); + is( $available_items->count, 2, "Filtered to 2 available items" ); - ok( $available_items->count == 2, "Filtered to 2 available items" ); + $available_items = Koha::Items->search( + { -and => { _status => 'available', biblionumber => $biblio->biblionumber } }, + ); + is( $available_items->count, 2, "Filtered to 2 available items - works when _status is in nested structure" ); my $item_3 = $builder->build_sample_item( { -- 2.39.5