From f4a9f785090dc7312b731de505ae88de851b6759 Mon Sep 17 00:00:00 2001
From: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Date: Wed, 6 Sep 2017 13:41:47 -0300
Subject: [PATCH] Bug 15339: Improve parameter validation

Only value and source are allowed

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
---
 t/db_dependent/TestBuilder.t | 2 +-
 t/lib/TestBuilder.pm         | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/t/db_dependent/TestBuilder.t b/t/db_dependent/TestBuilder.t
index c370b5a16c..5ef269fa24 100644
--- a/t/db_dependent/TestBuilder.t
+++ b/t/db_dependent/TestBuilder.t
@@ -397,7 +397,7 @@ subtest '->build parameter' => sub {
     warnings_are {
         $builder->build({
             source => 'Branch',
-            values => {
+            value => {
                 branchcode => 'BRANCH_1'
             }
         })
diff --git a/t/lib/TestBuilder.pm b/t/lib/TestBuilder.pm
index 45df23e62d..1b56f92603 100644
--- a/t/lib/TestBuilder.pm
+++ b/t/lib/TestBuilder.pm
@@ -89,7 +89,7 @@ sub build {
     my $source  = $params->{source} || return;
     my $value   = $params->{value};
 
-    my @unknowns = grep( !/source|value|only_fk/, keys %{ $params });
+    my @unknowns = grep( !/^(source|value)$/, keys %{ $params });
     carp "Unknown parameter(s): ", join( ', ', @unknowns ) if scalar @unknowns;
 
     my $col_values = $self->_buildColumnValues({
-- 
2.11.0