From 02558da79a217a1d3a70f1f8e2770cc30851b030 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 30 Aug 2016 17:03:59 +0100 Subject: [PATCH] Bug 17216: Fix other tests --- t/db_dependent/Koha.t | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/t/db_dependent/Koha.t b/t/db_dependent/Koha.t index 82fdc5e..b8ea314 100644 --- a/t/db_dependent/Koha.t +++ b/t/db_dependent/Koha.t @@ -7,6 +7,7 @@ use Modern::Perl; use C4::Context; use Koha::DateUtils qw(dt_from_string); use Koha::AuthorisedValue; +use Koha::AuthorisedValueCategories; use Test::More tests => 9; use DateTime::Format::MySQL; @@ -31,7 +32,8 @@ subtest 'Authorized Values Tests' => sub { imageurl => 'IMAGEURL' }; - + my $avc = Koha::AuthorisedValueCategories->find($data->{category}); + Koha::AuthorisedValueCategory->new({ category_name => $data->{category} })->store unless $avc; # Insert an entry into authorised_value table my $insert_success = Koha::AuthorisedValue->new( { category => $data->{category}, @@ -70,6 +72,7 @@ subtest 'Authorized Values Tests' => sub { SKIP: { eval { require Test::Deep; import Test::Deep; }; skip "Test::Deep required to run the GetAuthorisedValues() tests.", 2 if $@; + Koha::AuthorisedValueCategory->new({ category_name => 'BUG10656' })->store; Koha::AuthorisedValue->new( { category => 'BUG10656', authorised_value => 'ZZZ', @@ -298,6 +301,8 @@ subtest 'GetFrameworksLoop() tests' => sub { subtest 'GetItemTypesByCategory GetItemTypesCategorized test' => sub{ plan tests => 7; + my $avc = Koha::AuthorisedValueCategories->find('ITEMTYPECAT'); + Koha::AuthorisedValueCategory->new({ category_name => 'ITEMTYPECAT' })->store unless $avc; my $insertGroup = Koha::AuthorisedValue->new( { category => 'ITEMTYPECAT', authorised_value => 'Quertyware', -- 2.8.1