From b8450f13538d562cd3e16e3af6c4a512b4151f3d Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Tue, 22 Oct 2019 14:56:25 +0100 Subject: [PATCH] Bug 22445: Add tests for Koha::Biblio->custom_cover_image_url Sponsored-by: Orex Digital Signed-off-by: Hayley Mapley Signed-off-by: Hugo Agud Signed-off-by: Owen Leonard Signed-off-by: Michal Denar Signed-off-by: Kyle Hall Signed-off-by: Katrin Fischer Signed-off-by: Martin Renvoize --- t/db_dependent/Koha/Biblios.t | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/t/db_dependent/Koha/Biblios.t b/t/db_dependent/Koha/Biblios.t index a3892c5468..09765228fd 100644 --- a/t/db_dependent/Koha/Biblios.t +++ b/t/db_dependent/Koha/Biblios.t @@ -19,7 +19,7 @@ use Modern::Perl; -use Test::More tests => 5; +use Test::More tests => 6; use Test::Exception; use C4::Items; @@ -186,4 +186,19 @@ subtest 'can_be_transferred' => sub { .' is not possible.'); }; +subtest 'custom_cover_image_url' => sub { + plan tests => 1; + t::lib::Mocks::mock_preference( 'CustomCoverImagesURL', 'https://my_url/%isbn%_%issn%.png' ); + my $isbn = 'my_isbn'; + my $issn = 'my_issn'; + my $biblioitem = $builder->build_object( + { + class => 'Koha::Biblioitems', + value => { isbn => $isbn, issn => $issn } + } + ); + my $biblio = Koha::Biblios->find( $biblioitem->biblionumber ); + is( $biblio->custom_cover_image_url, "https://my_url/${isbn}_${issn}.png" ); +}; + $schema->storage->txn_rollback; -- 2.20.1