Bug 23406: Unit test

Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This commit is contained in:
Nick Clemens 2021-05-10 12:01:55 +00:00 committed by Jonathan Druart
parent 894a0ba5cf
commit 1489950a59
1 changed files with 13 additions and 1 deletions

View File

@ -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;