Bug 28676: Unit test
Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 869f1c758c)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
This commit is contained in:
parent
9dbf469605
commit
97dcf5ded6
|
|
@ -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");
|
||||
};
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue