Lines 21-26
use Modern::Perl;
Link Here
|
21 |
|
21 |
|
22 |
use Test::More tests => 6; |
22 |
use Test::More tests => 6; |
23 |
use Test::Exception; |
23 |
use Test::Exception; |
|
|
24 |
use MARC::Field; |
24 |
|
25 |
|
25 |
use C4::Items; |
26 |
use C4::Items; |
26 |
use C4::Biblio; |
27 |
use C4::Biblio; |
Lines 187-204
subtest 'can_be_transferred' => sub {
Link Here
|
187 |
}; |
188 |
}; |
188 |
|
189 |
|
189 |
subtest 'custom_cover_image_url' => sub { |
190 |
subtest 'custom_cover_image_url' => sub { |
190 |
plan tests => 1; |
191 |
plan tests => 2; |
|
|
192 |
|
191 |
t::lib::Mocks::mock_preference( 'CustomCoverImagesURL', 'https://my_url/%isbn%_%issn%.png' ); |
193 |
t::lib::Mocks::mock_preference( 'CustomCoverImagesURL', 'https://my_url/%isbn%_%issn%.png' ); |
|
|
194 |
|
192 |
my $isbn = 'my_isbn'; |
195 |
my $isbn = 'my_isbn'; |
193 |
my $issn = 'my_issn'; |
196 |
my $issn = 'my_issn'; |
194 |
my $biblioitem = $builder->build_object( |
197 |
my $marc_record = MARC::Record->new; |
195 |
{ |
198 |
my ( $biblionumber, undef ) = C4::Biblio::AddBiblio($marc_record, ''); |
196 |
class => 'Koha::Biblioitems', |
199 |
|
197 |
value => { isbn => $isbn, issn => $issn } |
200 |
my $biblio = Koha::Biblios->find( $biblionumber ); |
198 |
} |
201 |
my $biblioitem = $biblio->biblioitem->set( |
199 |
); |
202 |
{ isbn => $isbn, issn => $issn }); |
200 |
my $biblio = Koha::Biblios->find( $biblioitem->biblionumber ); |
|
|
201 |
is( $biblio->custom_cover_image_url, "https://my_url/${isbn}_${issn}.png" ); |
203 |
is( $biblio->custom_cover_image_url, "https://my_url/${isbn}_${issn}.png" ); |
|
|
204 |
|
205 |
my $marc_024a = '710347104926'; |
206 |
$marc_record->append_fields( MARC::Field->new( '024', '', '', a => $marc_024a ) ); |
207 |
C4::Biblio::ModBiblio( $marc_record, $biblio->biblionumber ); |
208 |
|
209 |
t::lib::Mocks::mock_preference( 'CustomCoverImagesURL', 'https://my_url/%024$a%.png' ); |
210 |
is( $biblio->custom_cover_image_url, "https://my_url/$marc_024a.png" ); |
202 |
}; |
211 |
}; |
203 |
|
212 |
|
204 |
$schema->storage->txn_rollback; |
213 |
$schema->storage->txn_rollback; |
205 |
- |
|
|