Bugzilla – Attachment 113585 Details for
Bug 27007
GetMarcSubfieldStructure called with "unsafe" in tests
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 27007: Don't call GetMarcSubfieldStructure with unsafe in tests
Bug-27007-Dont-call-GetMarcSubfieldStructure-with-.patch (text/plain), 1.97 KB, created by
Jonathan Druart
on 2020-11-13 08:33:59 UTC
(
hide
)
Description:
Bug 27007: Don't call GetMarcSubfieldStructure with unsafe in tests
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2020-11-13 08:33:59 UTC
Size:
1.97 KB
patch
obsolete
>From b9e6b250977305d168dcf679d3f834bf79396b66 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Fri, 13 Nov 2020 09:32:50 +0100 >Subject: [PATCH] Bug 27007: Don't call GetMarcSubfieldStructure with unsafe in > tests > >It does not feel correct to call GetMarcSubfieldStructure with the unsafe flag set in tests: > my $mss = C4::Biblio::GetMarcSubfieldStructure( '', { unsafe => 1 } ); > >Some tests are failing is run twice > >Use of uninitialized value $code_wanted in string eq at /usr/share/perl5/MARC/Field.pm line 314. >[x~10] >Use of uninitialized value $code_wanted in string eq at /usr/share/perl5/MARC/Field.pm line 314. > > # Failed test 'Value is mapped correctly for column biblionumber' > # at t/db_dependent/Koha/Item.t line 115. > # got: undef > # expected: '483' >[etc.] > >Test plan: >Run the tests twice, without the patch it fails, with the patch it >passes >--- > t/db_dependent/Koha/Item.t | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > >diff --git a/t/db_dependent/Koha/Item.t b/t/db_dependent/Koha/Item.t >index 0309fa94f6..38188f6231 100755 >--- a/t/db_dependent/Koha/Item.t >+++ b/t/db_dependent/Koha/Item.t >@@ -88,7 +88,7 @@ subtest 'has_pending_hold() tests' => sub { > > subtest "as_marc_field() tests" => sub { > >- my $mss = C4::Biblio::GetMarcSubfieldStructure( '', { unsafe => 1 } ); >+ my $mss = C4::Biblio::GetMarcSubfieldStructure( '' ); > > my @schema_columns = $schema->resultset('Item')->result_source->columns; > my @mapped_columns = grep { exists $mss->{'items.'.$_} } @schema_columns; >@@ -139,7 +139,7 @@ subtest "as_marc_field() tests" => sub { > } > )->store; > >- $mss = C4::Biblio::GetMarcSubfieldStructure( '', { unsafe => 0 } ); >+ $mss = C4::Biblio::GetMarcSubfieldStructure( '' ); > my @unlinked_subfields; > push @unlinked_subfields, X => 'Something weird'; > $item->more_subfields_xml( C4::Items::_get_unlinked_subfields_xml( \@unlinked_subfields ) )->store; >-- >2.20.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 27007
:
113585
|
113587