From 5c04f569a97d9341540a492915ee1b14e56dd743 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Phil Ringnalda Signed-off-by: Joonas Kylmälä Signed-off-by: Jonathan Druart Signed-off-by: Kyle M Hall (cherry picked from commit 869f1c758cb78454c48e180f1533893b5dcb5d11) Signed-off-by: Fridolin Somers (cherry picked from commit 97dcf5ded6fa6602ee645f3f6431b52b843bc8b9) Signed-off-by: Victor Grousset/tuxayo (cherry picked from commit e30c1a5c08900a148d8799f3ec4c02126e865ffa) Signed-off-by: Wainui Witika-Park (cherry picked from commit e30c1a5c08900a148d8799f3ec4c02126e865ffa) --- 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 99849a2b63..e0de85a17e 100755 --- a/t/db_dependent/Biblio.t +++ b/t/db_dependent/Biblio.t @@ -154,7 +154,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); @@ -175,6 +175,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.39.5