From 2431f8b6448044eb868b2349e882da98ec5f9d7c Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Wed, 2 Nov 2016 11:01:54 +0000 Subject: [PATCH] Bug 17538: (Bug 17216 follow-up) Fix t/db_dependent/Upload.t The insert into authorised_values failed because of the missing FK Test plan: prove t/db_dependent/Upload.t should return green --- t/db_dependent/Upload.t | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/t/db_dependent/Upload.t b/t/db_dependent/Upload.t index 1449c98..20791f3 100644 --- a/t/db_dependent/Upload.t +++ b/t/db_dependent/Upload.t @@ -161,7 +161,8 @@ sub test06 { #some extra tests for get sub test07 { #simple test for httpheaders and getCategories my @hdrs = Koha::Upload->httpheaders('does_not_matter_yet'); is( @hdrs == 4 && $hdrs[1] =~ /application\/octet-stream/, 1, 'Simple test for httpheaders'); - $dbh->do("INSERT INTO authorised_values (category, authorised_value, lib) VALUES (?,?,?) ", undef, ( 'UPLOAD', 'HAVE_AT_LEAST_ONE', 'Hi there' )); + my $builder = t::lib::TestBuilder->new; + $builder->build({ source => 'AuthorisedValue', value => { category => 'UPLOAD', authorised_value => 'HAVE_AT_LEAST_ONE', lib => 'Hi there' } }); my $cat = Koha::Upload->getCategories; is( @$cat >= 1, 1, 'getCategories returned at least one category' ); } -- 2.1.4