Bugzilla – Attachment 53411 Details for
Bug 16868
Silence error t/db_dependent/Linker_FirstMatch.t
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 16868: Silence error t/db_dependent/Linker_FirstMatch.t
Bug-16868-Silence-error-tdbdependentLinkerFirstMat.patch (text/plain), 2.17 KB, created by
Marc Véron
on 2016-07-15 06:59:41 UTC
(
hide
)
Description:
Bug 16868: Silence error t/db_dependent/Linker_FirstMatch.t
Filename:
MIME Type:
Creator:
Marc Véron
Created:
2016-07-15 06:59:41 UTC
Size:
2.17 KB
patch
obsolete
>From df4abfee4a1d43758b0b16570c8d57072df11942 Mon Sep 17 00:00:00 2001 >From: Mark Tompsett <mtompset@hotmail.com> >Date: Wed, 6 Jul 2016 21:37:21 -0400 >Subject: [PATCH] Bug 16868: Silence error t/db_dependent/Linker_FirstMatch.t >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >When the auth_header table has records which exclude 1xx and >2xx tags, the $bibfield doesn't match anything. This in turn >sets it to undef, which triggers an error on the next line >killing the test. > >LIMIT was removed as it is not necessary and is a >MySQL-ism. Though this may slow down testing with huge >auth_header files, it should not be significant. > >TEST PLAN >--------- >1) back up DB >2) Make sure to add in some authority records. >3) DELETE FROM auth_header WHERE marcxml LIKE '%datafield tag="1%'; > DELETE FROM auth_header WHERE marcxml LIKE '%datafield tag="2%'; > -- Now the test should blow up nicely. > -- If you find you have no records, add more such that you > repeat steps 2 and 3 and still have records in auth_header. > Sorry, getting the trigger data is the hard part. >4) prove t/db_dependent/Linker_FirstMatch.t > -- should barf before running all the tests >5) apply patch >6) prove t/db_dependent/Linker_FirstMatch.t > -- should have pretty skip message(s) >7) run koha qa test tools >8) restore your backup > >Signed-off-by: Marc Véron <veron@veron.ch> >--- > t/db_dependent/Linker_FirstMatch.t | 10 +++++++++- > 1 file changed, 9 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Linker_FirstMatch.t b/t/db_dependent/Linker_FirstMatch.t >index 66c03ba..2360681 100755 >--- a/t/db_dependent/Linker_FirstMatch.t >+++ b/t/db_dependent/Linker_FirstMatch.t >@@ -18,7 +18,15 @@ BEGIN { > } > my $dbh = C4::Context->dbh; > >-my $query = "SELECT authid, marc FROM auth_header LIMIT 1;"; >+my $where_clause = ' WHERE marcxml LIKE \'%datafield tag="'; >+if (C4::Context->preference('MARCFlavour') eq 'UNIMARC') { >+ $where_clause .= '2%\''; >+} else { >+ $where_clause .= '1%\''; >+} >+ >+my $query = "SELECT authid, marc FROM auth_header "; >+$query .= $where_clause; > my $sth = $dbh->prepare($query); > $sth->execute(); > my ($authid, $marc) = $sth->fetchrow_array(); >-- >1.7.10.4
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 16868
:
53154
|
53155
|
53411
|
53451
|
53452
|
53453
|
53454
|
53455
|
53549
|
53729
|
53880