From ebd1039bbdb041c7691eaaa2a977af9cd1687d3e Mon Sep 17 00:00:00 2001 From: Martin Persson Date: Tue, 8 Dec 2015 20:55:01 +0100 Subject: [PATCH] Bug 15339: TestBuilder warnings (code) Makes TestBuilder::build() alert the user when unreognized parameters are passed, which happens when the user supplies the column values directly, forgetting the 'value' hash. This patch holds the code changes. Examples of the kind of errors that it catches are in the tests (separate patch). Sponsored-By: Halland County Library Signed-off-by: Jonathan Druart Signed-off-by: Marcel de Rooy Signed-off-by: Jonathan Druart --- t/lib/TestBuilder.pm | 3 +++ 1 file changed, 3 insertions(+) diff --git a/t/lib/TestBuilder.pm b/t/lib/TestBuilder.pm index 2df9f0401e..45df23e62d 100644 --- a/t/lib/TestBuilder.pm +++ b/t/lib/TestBuilder.pm @@ -89,6 +89,9 @@ sub build { my $source = $params->{source} || return; my $value = $params->{value}; + my @unknowns = grep( !/source|value|only_fk/, keys %{ $params }); + carp "Unknown parameter(s): ", join( ', ', @unknowns ) if scalar @unknowns; + my $col_values = $self->_buildColumnValues({ source => $source, value => $value, -- 2.39.5