From 8f39c860a77161b7da6ff894f18991394bd9d469 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 Content-Type: text/plain; charset=utf-8 Only value and source are allowed Signed-off-by: Jonathan Druart Signed-off-by: Marcel de Rooy --- 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 c370b5a..5ef269f 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 45df23e..1b56f92 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.1.4