From c03bada3220cf5af53310f7d08f743b7e5bbcc40 Mon Sep 17 00:00:00 2001 From: Fridolin Somers Date: Fri, 26 Sep 2025 10:36:57 +0200 Subject: [PATCH] Bug 40883: Add unit test --- t/db_dependent/AuthoritiesMarc.t | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/t/db_dependent/AuthoritiesMarc.t b/t/db_dependent/AuthoritiesMarc.t index e223ddba34..b9e5e6baaa 100755 --- a/t/db_dependent/AuthoritiesMarc.t +++ b/t/db_dependent/AuthoritiesMarc.t @@ -6,7 +6,7 @@ use Modern::Perl; use Test::NoWarnings; -use Test::More tests => 14; +use Test::More tests => 15; use Test::MockModule; use Test::Warn; use MARC::Field; @@ -74,6 +74,12 @@ $module->mock( [ '001', '5' ], [ '100', ' ', ' ', a => 'Lastname, Firstname', b => 'b', c => 'c', i => 'i' ] ); + } elsif ( $authid eq '6' ) { + $record->add_fields( + [ '001', '6' ], + [ '199', ' ', ' ', a => 'Unkown heading' ], + [ '799', ' ', ' ', a => 'Unkown field', x => 'Unkown subdivision', 9 => '1' ] + ); } else { undef $record; } @@ -212,6 +218,10 @@ $marc21_subdiv->add_fields( [ '181', ' ', ' ', x => 'Political aspects' ] ); warning_is { BuildSummary( $marc21_subdiv, 99999, 'GEN_SUBDIV' ) } [], 'BuildSummary does not generate warning if main heading subfield not present'; +warning_is { + BuildSummary( C4::AuthoritiesMarc::GetAuthority(6), 6, 'CUSTOM_TYPE' ) } [], + 'BuildSummary does not generate warning if 7xx is unkown'; + t::lib::Mocks::mock_preference( 'marcflavour', 'UNIMARC' ); $dbh->do( q{ -- 2.43.0