Bugzilla – Attachment 147503 Details for
Bug 32894
Objects cache methods' result without invalidation
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 32894: Fix test
Bug-32894-Fix-test.patch (text/plain), 3.05 KB, created by
Jonathan Druart
on 2023-02-28 16:18:45 UTC
(
hide
)
Description:
Bug 32894: Fix test
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2023-02-28 16:18:45 UTC
Size:
3.05 KB
patch
obsolete
>From c39ae86458cb879f21e07152f5cab3cb997b20c1 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Tue, 28 Feb 2023 17:14:52 +0100 >Subject: [PATCH] Bug 32894: Fix test > >--- > t/db_dependent/Koha/Biblios.t | 22 +++++++++++++--------- > 1 file changed, 13 insertions(+), 9 deletions(-) > >diff --git a/t/db_dependent/Koha/Biblios.t b/t/db_dependent/Koha/Biblios.t >index b93efebb212..e93c1b658f4 100755 >--- a/t/db_dependent/Koha/Biblios.t >+++ b/t/db_dependent/Koha/Biblios.t >@@ -27,7 +27,7 @@ use Test::MockModule; > use MARC::Field; > > use C4::Items; >-use C4::Biblio qw( AddBiblio ModBiblio ); >+use C4::Biblio qw( AddBiblio ModBiblio GetMarcFromKohaField ); > use C4::Reserves qw( AddReserve ); > > use Koha::DateUtils qw( dt_from_string output_pref ); >@@ -200,20 +200,24 @@ subtest 'custom_cover_image_url' => sub { > my $isbn = '0553573403 | 9780553573404 (pbk.).png'; > my $issn = 'my_issn'; > my $cf_value = 'from_control_field'; >- my $marc_record = MARC::Record->new; >- my ( $biblionumber, undef ) = C4::Biblio::AddBiblio($marc_record, ''); >+ my $biblio = $builder->build_sample_biblio; >+ my $marc_record = $biblio->metadata->record; >+ my ( $isbn_tag, $isbn_subfield ) = GetMarcFromKohaField( 'biblioitems.isbn' ); >+ my ( $issn_tag, $issn_subfield ) = GetMarcFromKohaField( 'biblioitems.issn' ); >+ $marc_record->append_fields( >+ MARC::Field->new( $isbn_tag, '', '', $isbn_subfield => $isbn ), >+ MARC::Field->new( $issn_tag, '', '', $issn_subfield => $issn ), >+ ); >+ C4::Biblio::ModBiblio( $marc_record, $biblio->biblionumber ); > >- my $biblio = Koha::Biblios->find( $biblionumber ); >- my $biblioitem = $biblio->biblioitem->set( >- { isbn => $isbn, issn => $issn }); >- is( $biblio->custom_cover_image_url, "https://my_url/${isbn}_${issn}.png" ); >+ is( $biblio->get_from_storage->custom_cover_image_url, "https://my_url/${isbn}_${issn}.png" ); > > my $marc_024a = '710347104926'; > $marc_record->append_fields( MARC::Field->new( '024', '', '', a => $marc_024a ) ); > C4::Biblio::ModBiblio( $marc_record, $biblio->biblionumber ); > > t::lib::Mocks::mock_preference( 'CustomCoverImagesURL', 'https://my_url/{024$a}.png' ); >- is( $biblio->custom_cover_image_url, "https://my_url/$marc_024a.png" ); >+ is( $biblio->get_from_storage->custom_cover_image_url, "https://my_url/$marc_024a.png" ); > > t::lib::Mocks::mock_preference( 'CustomCoverImagesURL', 'https://my_url/{normalized_isbn}.png' ); > my $normalized_isbn = C4::Koha::GetNormalizedISBN($isbn); >@@ -226,7 +230,7 @@ subtest 'custom_cover_image_url' => sub { > is( $biblio->custom_cover_image_url, undef, 'Record does not have 001' ); > $marc_record->append_fields(MARC::Field->new('001', $cf_value)); > C4::Biblio::ModBiblio( $marc_record, $biblio->biblionumber ); >- $biblio = Koha::Biblios->find( $biblionumber ); >+ $biblio = Koha::Biblios->find( $biblio->biblionumber ); > is( $biblio->get_from_storage->custom_cover_image_url, "https://my_url/$cf_value.png", 'URL generated using 001' ); > }; > >-- >2.25.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 32894
:
147499
|
147500
|
147502
|
147503
|
150016
|
150017
|
150018
|
150019
|
150020
|
150021
|
150827
|
150828
|
150847
|
150848
|
150849
|
150850
|
150851
|
150852
|
150853
|
150854
|
150855
|
152086
|
152087
|
152088
|
152089
|
152090
|
152091
|
152092
|
152093
|
152094