From 84a3e1adabbbf2ac0cabc429d1a8cf027bc3b264 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Wed, 7 Sep 2016 09:49:15 +0100 Subject: [PATCH] Bug 17212: Add tests --- t/db_dependent/Koha.t | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/t/db_dependent/Koha.t b/t/db_dependent/Koha.t index 82fdc5e..05ec726 100644 --- a/t/db_dependent/Koha.t +++ b/t/db_dependent/Koha.t @@ -296,11 +296,12 @@ subtest 'GetFrameworksLoop() tests' => sub { }; subtest 'GetItemTypesByCategory GetItemTypesCategorized test' => sub{ - plan tests => 7; + plan tests => 8; my $insertGroup = Koha::AuthorisedValue->new( { category => 'ITEMTYPECAT', authorised_value => 'Quertyware', + lib_opac => 'lib4itemtypecat', } )->store; @@ -345,6 +346,17 @@ subtest 'GetItemTypesByCategory GetItemTypesCategorized test' => sub{ } @expected = ( 'BKghjklo1', 'Qwertyware', 'Veryheavybook' ); is_deeply(\@results,\@expected, 'GetItemTypesCategorized: grouped and ungrouped items returned as expected.'); + + Koha::AuthorisedValue->new( + { category => 'CCODE', + authorised_value => 'Qwertyware', + lib_opac => 'lib4ccode', + } + )->store; + + $hrCat = GetItemTypesCategorized(); + is( $hrCat->{Qwertyware}{description}, 'lib4itemtypecat', 'GetItemTypesCategorized should correctly retrieve the lib_opac if another AV exist with the same code' ); + }; subtest 'GetItemTypes test' => sub { -- 2.8.1