From e745772fbc43e4aee58816094131af6862054cf2 Mon Sep 17 00:00:00 2001 From: David Gustafsson Date: Wed, 19 Oct 2022 16:11:15 +0200 Subject: [PATCH] Bug 31856: Add test for get_description_by_category_and_authorised_value --- t/db_dependent/AuthorisedValues.t | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/t/db_dependent/AuthorisedValues.t b/t/db_dependent/AuthorisedValues.t index c768fee68f..f31a4a8ee5 100755 --- a/t/db_dependent/AuthorisedValues.t +++ b/t/db_dependent/AuthorisedValues.t @@ -140,7 +140,7 @@ my @categories = Koha::AuthorisedValues->new->categories; is( @categories, @existing_categories+3, 'There should have 3 categories inserted' ); subtest 'search_by_*_field + find_by_koha_field + get_description' => sub { - plan tests => 5; + plan tests => 6; my $test_cat = Koha::AuthorisedValueCategories->find('TEST'); $test_cat->delete if $test_cat; @@ -248,6 +248,22 @@ subtest 'search_by_*_field + find_by_koha_field + get_description' => sub { ], ); }; + subtest 'get_description_by_category_and_authorised_value' => sub { + plan tests => 1; + my $description = Koha::AuthorisedValues->get_description_by_category_and_authorised_value( + { + category => $av_0->category,, + authorised_value => $av_0->authorised_value, + } + ); + is_deeply( + $description, + { + lib => $av_0->lib, + opac_description => $av_0->lib_opac + } + ); + }; }; $schema->storage->txn_rollback; -- 2.35.1