From 326d374c5e58544a56b298f453cf59a4005928e4 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Mon, 17 Oct 2022 15:59:52 +0200 Subject: [PATCH] Bug 31154: Add test Content-Type: text/plain; charset=utf-8 Signed-off-by: Marcel de Rooy --- t/db_dependent/Koha/UI/Form/Builder/Item.t | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/t/db_dependent/Koha/UI/Form/Builder/Item.t b/t/db_dependent/Koha/UI/Form/Builder/Item.t index f5c3336888..3be0647dc0 100755 --- a/t/db_dependent/Koha/UI/Form/Builder/Item.t +++ b/t/db_dependent/Koha/UI/Form/Builder/Item.t @@ -16,7 +16,7 @@ # along with Koha; if not, see . use Modern::Perl; -use Test::More tests => 8; +use Test::More tests => 9; use Data::Dumper qw( Dumper ); use utf8; @@ -26,6 +26,7 @@ use Koha::Libraries; use Koha::MarcSubfieldStructures; use Koha::UI::Form::Builder::Item; use t::lib::TestBuilder; +use t::lib::Mocks; my $schema = Koha::Database->new->schema; $schema->storage->txn_begin; @@ -334,6 +335,19 @@ subtest 'ignore_invisible_subfields' => sub { undef, 'items.issues not copied if ignore_invisible_subfields is passed' ); }; +subtest 'Fix subfill_with_default_values - no biblionumber passed' => sub { + plan tests => 1; + + t::lib::Mocks::mock_preference('itemcallnumber', '082ab,092ab'); + my $item = $builder->build_sample_item; + my $subfields = Koha::UI::Form::Builder::Item->new( + { + item => $item->unblessed, + } + )->edit_form({ prefill_with_default_values => 1 }); + pass(); +}; + $cache->clear_from_cache("MarcStructure-0-"); $cache->clear_from_cache("MarcStructure-1-"); $cache->clear_from_cache("default_value_for_mod_marc-"); -- 2.30.2