|
Lines 190-196
subtest 'can_be_transferred' => sub {
Link Here
|
| 190 |
subtest 'custom_cover_image_url' => sub { |
190 |
subtest 'custom_cover_image_url' => sub { |
| 191 |
plan tests => 3; |
191 |
plan tests => 3; |
| 192 |
|
192 |
|
| 193 |
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 |
|
194 |
|
| 195 |
my $isbn = '0553573403 | 9780553573404 (pbk.).png'; |
195 |
my $isbn = '0553573403 | 9780553573404 (pbk.).png'; |
| 196 |
my $issn = 'my_issn'; |
196 |
my $issn = 'my_issn'; |
|
Lines 206-215
subtest 'custom_cover_image_url' => sub {
Link Here
|
| 206 |
$marc_record->append_fields( MARC::Field->new( '024', '', '', a => $marc_024a ) ); |
206 |
$marc_record->append_fields( MARC::Field->new( '024', '', '', a => $marc_024a ) ); |
| 207 |
C4::Biblio::ModBiblio( $marc_record, $biblio->biblionumber ); |
207 |
C4::Biblio::ModBiblio( $marc_record, $biblio->biblionumber ); |
| 208 |
|
208 |
|
| 209 |
t::lib::Mocks::mock_preference( 'CustomCoverImagesURL', 'https://my_url/%024$a%.png' ); |
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" ); |
210 |
is( $biblio->custom_cover_image_url, "https://my_url/$marc_024a.png" ); |
| 211 |
|
211 |
|
| 212 |
t::lib::Mocks::mock_preference( 'CustomCoverImagesURL', 'https://my_url/%normalized_isbn%.png' ); |
212 |
t::lib::Mocks::mock_preference( 'CustomCoverImagesURL', 'https://my_url/{normalized_isbn}.png' ); |
| 213 |
my $normalized_isbn = C4::Koha::GetNormalizedISBN($isbn); |
213 |
my $normalized_isbn = C4::Koha::GetNormalizedISBN($isbn); |
| 214 |
is( $biblio->custom_cover_image_url, "https://my_url/$normalized_isbn.png" ); |
214 |
is( $biblio->custom_cover_image_url, "https://my_url/$normalized_isbn.png" ); |
| 215 |
}; |
215 |
}; |
| 216 |
- |
|
|