|
Lines 590-592
subtest 'ModBiblio called from linker test' => sub {
Link Here
|
| 590 |
# Cleanup |
590 |
# Cleanup |
| 591 |
Koha::Caches->get_instance->clear_from_cache( "MarcSubfieldStructure-" ); |
591 |
Koha::Caches->get_instance->clear_from_cache( "MarcSubfieldStructure-" ); |
| 592 |
$schema->storage->txn_rollback; |
592 |
$schema->storage->txn_rollback; |
| 593 |
- |
593 |
|
|
|
594 |
subtest 'GetCOinSBiblio and GetOpenURLResolverURL' => sub { |
| 595 |
plan tests => 2; |
| 596 |
|
| 597 |
$schema->storage->txn_begin; |
| 598 |
|
| 599 |
my $builder = t::lib::TestBuilder->new; |
| 600 |
my $biblio = $builder->build_sample_biblio({ |
| 601 |
title => 'Title 1', |
| 602 |
author => 'Author 1' |
| 603 |
}); |
| 604 |
my $record = $biblio->metadata->record; |
| 605 |
|
| 606 |
t::lib::Mocks::mock_preference("OpenURLResolverURL", "https://koha.example.com/"); |
| 607 |
|
| 608 |
is( |
| 609 |
C4::Biblio::GetCOinSBiblio($record), |
| 610 |
'ctx_ver=Z39.88-2004&rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Abook&rft.genre=book&rft.btitle=Title%201&rft.au=Author%201', |
| 611 |
'GetCOinsBiblio returned right metadata' |
| 612 |
); |
| 613 |
|
| 614 |
is( |
| 615 |
C4::Biblio::GetOpenURLResolverURL($record), |
| 616 |
'https://koha.example.com/?ctx_ver=Z39.88-2004&rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Abook&rft.genre=book&rft.btitle=Title%201&rft.au=Author%201', |
| 617 |
'GetOpenURLResolverURL returned right URL' |
| 618 |
); |
| 619 |
|
| 620 |
$schema->storage->txn_rollback; |
| 621 |
}; |