From c6464a27222d8a487e1977f713df53db6b47597f Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Mon, 10 May 2021 12:01:55 +0000 Subject: [PATCH] Bug 23406: Unit test Signed-off-by: Phil Ringnalda --- t/db_dependent/XSLT.t | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/t/db_dependent/XSLT.t b/t/db_dependent/XSLT.t index 87e00a4bf5..37637e6fa8 100755 --- a/t/db_dependent/XSLT.t +++ b/t/db_dependent/XSLT.t @@ -17,7 +17,8 @@ use Modern::Perl; -use Test::More tests => 2; +use MARC::Record; +use Test::More tests => 3; use Test::Warn; use t::lib::TestBuilder; use t::lib::Mocks; @@ -33,6 +34,17 @@ my $builder = t::lib::TestBuilder->new; $schema->storage->txn_begin; +subtest 'transformMARCXML4XSLT tests' => sub { + plan tests => 1; + my $mock_xslt = Test::MockModule->new("C4::XSLT"); + $mock_xslt->mock( getAuthorisedValues4MARCSubfields => sub { return { 942 => { 'n' => 1 } } } ); + $mock_xslt->mock( GetAuthorisedValueDesc => sub { warn "called"; }); + my $record = MARC::Record->new(); + my $suppress_field = MARC::Field->new( 942, ' ', ' ', n => '1' ); + $record->append_fields($suppress_field); + warning_is { C4::XSLT::transformMARCXML4XSLT( 3,$record ) } undef, "942n auth value not translated"; +}; + subtest 'buildKohaItemsNamespace status tests' => sub { plan tests => 14; -- 2.26.1