Lines 17-23
Link Here
|
17 |
|
17 |
|
18 |
use Modern::Perl; |
18 |
use Modern::Perl; |
19 |
|
19 |
|
20 |
use Test::More tests => 11; |
20 |
use Test::More tests => 12; |
21 |
use Test::MockModule; |
21 |
use Test::MockModule; |
22 |
use List::MoreUtils qw( uniq ); |
22 |
use List::MoreUtils qw( uniq ); |
23 |
use MARC::Record; |
23 |
use MARC::Record; |
Lines 495-500
subtest 'MarcFieldForCreatorAndModifier' => sub {
Link Here
|
495 |
is($record->subfield('998', 'd'), 'Jane Doe', '998$d = Jane Doe'); |
495 |
is($record->subfield('998', 'd'), 'Jane Doe', '998$d = Jane Doe'); |
496 |
}; |
496 |
}; |
497 |
|
497 |
|
|
|
498 |
subtest 'ModBiblio called from linker test' => sub { |
499 |
plan tests => 2; |
500 |
my $called = 0; |
501 |
t::lib::Mocks::mock_preference('BiblioAddsAuthorities', 1); |
502 |
my $biblio_mod = Test::MockModule->new( 'C4::Biblio' ); |
503 |
$biblio_mod->mock( 'LinkBibHeadingsToAuthorities', sub { |
504 |
$called = 1; |
505 |
}); |
506 |
my $record = MARC::Record->new(); |
507 |
my ($biblionumber) = C4::Biblio::AddBiblio($record,''); |
508 |
C4::Biblio::ModBiblio($record,$biblionumber,''); |
509 |
is($called,1,"We called to link bibs because not from linker"); |
510 |
$called = 0; |
511 |
C4::Biblio::ModBiblio($record,$biblionumber,'',1); |
512 |
is($called,0,"We didn't call to link bibs because from linker"); |
513 |
}; |
514 |
|
498 |
# Cleanup |
515 |
# Cleanup |
499 |
Koha::Caches->get_instance->clear_from_cache( "MarcSubfieldStructure-" ); |
516 |
Koha::Caches->get_instance->clear_from_cache( "MarcSubfieldStructure-" ); |
500 |
$schema->storage->txn_rollback; |
517 |
$schema->storage->txn_rollback; |
501 |
- |
|
|