|
Lines 42-48
my $schema = $builder->schema();
Link Here
|
| 42 |
$schema->storage->txn_begin; |
42 |
$schema->storage->txn_begin; |
| 43 |
|
43 |
|
| 44 |
subtest 'Test caching in get_link and update_cache' => sub { |
44 |
subtest 'Test caching in get_link and update_cache' => sub { |
| 45 |
plan tests => 16; |
45 |
plan tests => 18; |
| 46 |
|
46 |
|
| 47 |
my @tags = C4::Context->preference('marcflavour') eq 'UNIMARC' ? (601,'j',602,'a') : (650,'a',655,'a'); |
47 |
my @tags = C4::Context->preference('marcflavour') eq 'UNIMARC' ? (601,'j',602,'a') : (650,'a',655,'a'); |
| 48 |
|
48 |
|
|
Lines 120-125
subtest 'Test caching in get_link and update_cache' => sub {
Link Here
|
| 120 |
is( $authid, 4, "Correct id for sao term is retrieved from the cache" ); |
120 |
is( $authid, 4, "Correct id for sao term is retrieved from the cache" ); |
| 121 |
$linker->update_cache($subject_heading4,78); |
121 |
$linker->update_cache($subject_heading4,78); |
| 122 |
is( $linker->{cache}->{$subject_heading4->search_form.$subject_heading4->auth_type.$subject_heading4->{'thesaurus'}}->{authid}, 78, "Linker cache for the bnb record is correctly updated by 'update_cache'"); |
122 |
is( $linker->{cache}->{$subject_heading4->search_form.$subject_heading4->auth_type.$subject_heading4->{'thesaurus'}}->{authid}, 78, "Linker cache for the bnb record is correctly updated by 'update_cache'"); |
|
|
123 |
|
| 124 |
t::lib::Mocks::mock_preference('LinkerConsiderThesaurus',0); |
| 125 |
$linker->update_cache($subject_heading,32); |
| 126 |
is( $linker->{cache}->{$subject_heading->search_form.$subject_heading->auth_type.'notconsidered'}->{authid}, 32, "Linker cache is correctly updated by 'update_cache'"); |
| 127 |
( $authid, undef ) = $linker->get_link($subject_heading); |
| 128 |
is( $authid, 32, "Correct id is retrieved from the cache" ); |
| 129 |
|
| 123 |
}; |
130 |
}; |
| 124 |
|
131 |
|
| 125 |
$schema->storage->txn_rollback; |
132 |
$schema->storage->txn_rollback; |
| 126 |
- |
|
|