From 26eb19783af46da84525c78eafc0d7488a7924ae Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Mon, 24 Jan 2022 17:01:11 +0100 Subject: [PATCH] Bug 29697: Fix tests --- t/db_dependent/Biblio.t | 6 +++--- t/db_dependent/Biblio/MarcOverlayRules.t | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/t/db_dependent/Biblio.t b/t/db_dependent/Biblio.t index c62933fb577..6c4f4c1e7bb 100755 --- a/t/db_dependent/Biblio.t +++ b/t/db_dependent/Biblio.t @@ -285,7 +285,7 @@ sub run_tests { is( $data->{ title }, $title, 'ModBiblio correctly added the title field, and GetBiblioData.'); is( $data->{ isbn }, $isbn, '(ModBiblio) ISBN is still there after ModBiblio.'); - $marc = $biblio->metadata->record; + $marc = $biblio->get_from_storage->metadata->record; my ( $title_field, $title_subfield ) = get_title_field(); is( $marc->subfield( $title_field, $title_subfield ), $title, ); @@ -422,8 +422,8 @@ sub run_tests { is( GetMarcPrice( $record_for_isbn, $marcflavour ), 100, "GetMarcPrice returns the correct value"); - my $updatedrecord = $biblio->metadata->record; my $frameworkcode = GetFrameworkCode($biblionumber); + my $updatedrecord = $biblio->metadata->record; my ( $biblioitem_tag, $biblioitem_subfield ) = GetMarcFromKohaField( "biblioitems.biblioitemnumber" ); die qq{No biblioitemnumber tag for framework "$frameworkcode"} unless $biblioitem_tag; my $biblioitemnumbertotest; @@ -709,7 +709,7 @@ subtest 'MarcFieldForCreatorAndModifier' => sub { $c4_context->mock('userenv', sub { return { number => 321, firstname => 'Jane', surname => 'Doe'}; }); C4::Biblio::ModBiblio($record, $biblionumber, ''); - $record = $biblio->metadata->record; + $record = $biblio->get_from_storage->metadata->record; is($record->subfield('998', 'a'), 123, '998$a = 123'); is($record->subfield('998', 'b'), 'John Doe', '998$b = John Doe'); is($record->subfield('998', 'c'), 321, '998$c = 321'); diff --git a/t/db_dependent/Biblio/MarcOverlayRules.t b/t/db_dependent/Biblio/MarcOverlayRules.t index dd3c7205997..dc66860a8bb 100755 --- a/t/db_dependent/Biblio/MarcOverlayRules.t +++ b/t/db_dependent/Biblio/MarcOverlayRules.t @@ -785,7 +785,7 @@ subtest 'context option in ModBiblio is handled correctly' => sub { ModBiblio($saved_record, $biblionumber, '', { overlay_context => { 'source' => 'test' } }); - my $updated_record = $biblio->metadata->record; + my $updated_record = $biblio->get_from_storage->metadata->record; $expected_record = build_record([ # "250" field has been appended -- 2.25.1