From 987b68434b6ffbf85ffa5babc502bc345635713d Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Wed, 7 Jul 2021 15:39:21 +0000 Subject: [PATCH] Bug 28676: Unit test Signed-off-by: Phil Ringnalda --- t/db_dependent/Biblio.t | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/t/db_dependent/Biblio.t b/t/db_dependent/Biblio.t index 4515303044..b9cb2a4398 100755 --- a/t/db_dependent/Biblio.t +++ b/t/db_dependent/Biblio.t @@ -167,7 +167,7 @@ subtest "GetMarcFromKohaField" => sub { }; subtest "Authority creation with default linker" => sub { - plan tests => 2; + plan tests => 4; # Automatic authority creation t::lib::Mocks::mock_preference('LinkerModule', 'Default'); t::lib::Mocks::mock_preference('BiblioAddsAuthorities', 1); @@ -188,6 +188,10 @@ subtest "Authority creation with default linker" => sub { my ($num_changed,$results) = LinkBibHeadingsToAuthorities($linker, $marc_record, "",undef); is( $num_changed, 0, "We shouldn't link or create a new record"); ok( !defined $results->{added}, "If we have multiple matches, we shouldn't create a new record"); + + ($num_changed,$results) = LinkBibHeadingsToAuthorities($linker, $marc_record, "",undef); + is( $num_changed, 0, "We shouldn't link or create a new record using cached result"); + ok( !defined $results->{added}, "If we have multiple matches, we shouldn't create a new record on second instance"); }; -- 2.26.1