From d60cc56613755a432bb0962b2e808229c8c575c1 Mon Sep 17 00:00:00 2001 From: Jonathan Druart 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 Signed-off-by: Marcel de Rooy Signed-off-by: Jonathan Druart --- 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.39.5