From d7d8730fbe631093cb9e1c96f0af60f795f5a3c7 Mon Sep 17 00:00:00 2001 From: Baptiste Wojtkowski Date: Thu, 23 Jan 2025 17:11:00 +0100 Subject: [PATCH] Bug 38528: (follow-up) add test for prepare_cgi_additional_field_values --- .../Koha/Object/Mixin/AdditionalFields.t | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/t/db_dependent/Koha/Object/Mixin/AdditionalFields.t b/t/db_dependent/Koha/Object/Mixin/AdditionalFields.t index e49c6b48..7ee47e0b 100755 --- a/t/db_dependent/Koha/Object/Mixin/AdditionalFields.t +++ b/t/db_dependent/Koha/Object/Mixin/AdditionalFields.t @@ -240,6 +240,13 @@ subtest 'prepare_cgi_additional_field_values' => sub { } ); $field2->store()->discard_changes(); + my $field3 = Koha::AdditionalField->new( + { + tablename => 'subscription', + name => random_string( 'c' x 100 ) + } + ); + $field3->store()->discard_changes(); my $q = CGI->new; $q->param( @@ -250,6 +257,10 @@ subtest 'prepare_cgi_additional_field_values' => sub { -name => 'additional_field_' . $field2->id, -value => '0', ); + $q->param( + -name => 'additional_field_' . $field3->id, + -value => '', + ); $q->param( -name => 'irrelevant_param', -value => 'foo', @@ -272,11 +283,13 @@ subtest 'prepare_cgi_additional_field_values' => sub { { 'value' => '0', 'id' => $field2->id + }, + { + 'value' => '', + 'id' => $field3->id } ], 'Return of prepare_cgi_additional_field_values should be correct' ); - $schema->txn_rollback; - }; -- 2.30.2