@@ -, +, @@ --- t/lib/TestBuilder.pm | 6 ++++++ 1 file changed, 6 insertions(+) --- a/t/lib/TestBuilder.pm +++ a/t/lib/TestBuilder.pm @@ -12,6 +12,7 @@ use Bytes::Random::Secure; use Carp qw( carp ); use Module::Load qw( load ); use String::Random; +use List::Util qw( any ); use constant { SIZE_BARCODE => 20, # Not perfect but avoid to fetch the value when creating a new item @@ -280,6 +281,11 @@ sub _buildColumnValues { my @columns = $self->schema->source($source)->columns; my %unique_constraints = $self->schema->source($source)->unique_constraints(); + for my $key ( keys %{$original_value} ) { + die "value passed for unrecognised column: $key" + if !( any { $key eq $_ } @columns ); + } + my $build_value = 5; # we try max $build_value times if there are unique constraints BUILD_VALUE: while ( $build_value ) { --