View | Details | Raw Unified | Return to bug 8995
Collapse All | Expand All

(-)a/t/db_dependent/Biblio.t (-2 / +30 lines)
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 573-575 subtest 'MarcFieldForCreatorAndModifier' => sub { Link Here
573
# Cleanup
573
# Cleanup
574
Koha::Caches->get_instance->clear_from_cache( "MarcSubfieldStructure-" );
574
Koha::Caches->get_instance->clear_from_cache( "MarcSubfieldStructure-" );
575
$schema->storage->txn_rollback;
575
$schema->storage->txn_rollback;
576
- 
576
577
subtest 'GetCOinSBiblio and GetOpenURLResolverURL' => sub {
578
    plan tests => 2;
579
580
    $schema->storage->txn_begin;
581
582
    my $builder = t::lib::TestBuilder->new;
583
    my $biblio = $builder->build_sample_biblio({
584
            title => 'Title 1',
585
            author => 'Author 1'
586
        });
587
    my $record = $biblio->metadata->record;
588
589
    t::lib::Mocks::mock_preference("OpenURLResolverURL", "https://koha.example.com/");
590
591
    is(
592
        C4::Biblio::GetCOinSBiblio($record),
593
        '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',
594
        'GetCOinsBiblio returned right metadata'
595
    );
596
597
    is(
598
        C4::Biblio::GetOpenURLResolverURL($record),
599
        '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',
600
        'GetOpenURLResolverURL returned right URL'
601
    );
602
603
    $schema->storage->txn_rollback;
604
};

Return to bug 8995