From 00dc17d74a0d22712b589db9b1f0a8a63a955915 Mon Sep 17 00:00:00 2001 From: Janusz Kaczmarek Date: Mon, 26 Jan 2026 16:55:32 +0000 Subject: [PATCH] Bug 41713: Unit tests --- t/db_dependent/Koha/Biblio.t | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/t/db_dependent/Koha/Biblio.t b/t/db_dependent/Koha/Biblio.t index b4b282c248..2e22154259 100755 --- a/t/db_dependent/Koha/Biblio.t +++ b/t/db_dependent/Koha/Biblio.t @@ -880,7 +880,7 @@ subtest 'suggestions() tests' => sub { subtest 'get_marc_components() tests' => sub { - plan tests => 5; + plan tests => 6; $schema->storage->txn_begin; @@ -929,6 +929,19 @@ subtest 'get_marc_components() tests' => sub { ); $search_mod->unmock('search_compat'); + my $record = MARC::Record->new; + $record->append_fields( MARC::Field->new( '245', ' ', ' ', a => 'Some title' ) ); + + my ($biblio_id) = AddBiblio( $record, qw{} ); + my $biblio = Koha::Biblios->find($biblio_id); + + t::lib::Mocks::mock_preference( 'marcflavour', 'MARC21' ); + t::lib::Mocks::mock_preference( 'UseControlNumber', 1 ); + t::lib::Mocks::mock_preference( 'SearchEngine', 'Elasticsearch' ); + + warning_is { $components = $biblio->get_marc_components(1) } + q{}, 'No warning expected'; + $schema->storage->txn_rollback; }; -- 2.39.5