From ab15177406a3c7c64380adeeb5ef8be8caa37a92 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 30 Aug 2016 17:03:59 +0100 Subject: [PATCH] [PASSED QA] Bug 17216: Fix other tests Signed-off-by: Katrin Fischer --- 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 1fab9db..8392ef8 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}, @@ -61,6 +63,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', @@ -289,6 +292,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.7.4