[Koha-bugs] [Bug 32350] Should we die if TestBuilder is passed a column we're not expecting

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Fri Nov 25 09:40:37 CET 2022


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32350

--- Comment #8 from Jonathan Druart <jonathan.druart+koha at gmail.com> ---
diff --git a/t/lib/TestBuilder.pm b/t/lib/TestBuilder.pm
index d065835ded0..d9e48b45c54 100644
--- a/t/lib/TestBuilder.pm
+++ b/t/lib/TestBuilder.pm
@@ -8,6 +8,7 @@ use Koha::Biblios qw( _type );
 use Koha::Items qw( _type );
 use Koha::DateUtils qw( dt_from_string );

+use Array::Utils qw( intersect );
 use Bytes::Random::Secure;
 use Carp qw( carp );
 use Module::Load qw( load );
@@ -280,6 +281,9 @@ sub _buildColumnValues {
     my @columns = $self->schema->source($source)->columns;
     my %unique_constraints =
$self->schema->source($source)->unique_constraints();

+    my @intersect = intersect( keys %$original_value, @columns );
+    die Dumper @intersect if @intersect;
+
     my $build_value = 5;
     # we try max $build_value times if there are unique constraints
     BUILD_VALUE: while ( $build_value ) {

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list