From b09273f19dbddf9cfa80629b7b793b13e3cb507f Mon Sep 17 00:00:00 2001 From: David Cook Date: Mon, 18 Dec 2023 00:11:32 +0000 Subject: [PATCH] Bug 35579: Add unit test Signed-off-by: David Nind Signed-off-by: Julian Maurice --- t/db_dependent/AuthorisedValues.t | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/t/db_dependent/AuthorisedValues.t b/t/db_dependent/AuthorisedValues.t index a1bf7b48125..f4f57d1974a 100755 --- a/t/db_dependent/AuthorisedValues.t +++ b/t/db_dependent/AuthorisedValues.t @@ -144,7 +144,7 @@ is_deeply( ); subtest 'search_by_*_field + find_by_koha_field + get_description + authorised_values' => sub { - plan tests => 6; + plan tests => 7; my $test_cat = Koha::AuthorisedValueCategories->find('TEST'); $test_cat->delete if $test_cat; @@ -252,6 +252,21 @@ subtest 'search_by_*_field + find_by_koha_field + get_description + authorised_v ], ); }; + + subtest 'get_descriptions_by_marc_field' => sub { + plan tests => 1; + my $descriptions = Koha::AuthorisedValues->get_descriptions_by_marc_field( + { frameworkcode => '', tagfield => '952', tagsubfield => 'c' } ); + is_deeply( + $descriptions, + { + 'location_1' => 'location_1', + 'location_2' => 'location_2', + 'location_3' => 'location_3', + }, + ); + }; + subtest 'authorised_values' => sub { plan tests => 2; -- 2.30.2