Bugzilla – Attachment 29385 Details for
Bug 12419
Not for loan items are not listed
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 12419: (QA followup) regression tests
Bug-12419-QA-followup-regression-tests.patch (text/plain), 5.42 KB, created by
Tomás Cohen Arazi (tcohen)
on 2014-06-30 18:56:42 UTC
(
hide
)
Description:
Bug 12419: (QA followup) regression tests
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2014-06-30 18:56:42 UTC
Size:
5.42 KB
patch
obsolete
>From 34fe2eaab2b4eae79c60d655709f5b6eaf27dca6 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@gmail.com> >Date: Mon, 30 Jun 2014 14:55:04 -0300 >Subject: [PATCH] Bug 12419: (QA followup) regression tests > >Changes to searchResults deserve unit tests. > >Edit: minor tweaks: > - Remove warning in line 702 > - Modernize > - License added > - "This file is a stub" removed > >Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com> >--- > t/db_dependent/Search.t | 32 +++++++++++++++++----- > .../large_biblio_dom/exported_records.xml | 12 ++++++++ > .../large_biblio_grs1/exported_records.xml | 12 ++++++++ > 3 files changed, 49 insertions(+), 7 deletions(-) > >diff --git a/t/db_dependent/Search.t b/t/db_dependent/Search.t >index 46d63f4..cadfedb 100644 >--- a/t/db_dependent/Search.t >+++ b/t/db_dependent/Search.t >@@ -1,10 +1,22 @@ > #!/usr/bin/perl >+ >+# This file is part of Koha. >+# >+# Koha is free software; you can redistribute it and/or modify it >+# under the terms of the GNU General Public License as published by >+# the Free Software Foundation; either version 3 of the License, or >+# (at your option) any later version. >+# >+# Koha is distributed in the hope that it will be useful, but >+# WITHOUT ANY WARRANTY; without even the implied warranty of >+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the >+# GNU General Public License for more details. > # >-# This Koha test module is a stub! >-# Add more tests here!!! >+# You should have received a copy of the GNU General Public License >+# along with Koha; if not, see <http://www.gnu.org/licenses>. >+ >+use Modern::Perl; > >-use strict; >-use warnings; > use utf8; > > use YAML; >@@ -675,7 +687,7 @@ if ( $indexing_mode eq 'dom' ) { > # make one of the test items appear to be in transit > my $circ_module = new Test::MockModule('C4::Circulation'); > $circ_module->mock('GetTransfers', sub { >- my $itemnumber = shift; >+ my $itemnumber = shift // -1; > if ($itemnumber == 11) { > return ('2013-07-19', 'MPL', 'CPL'); > } else { >@@ -833,6 +845,12 @@ if ( $indexing_mode eq 'dom' ) { > is($newresults[0]->{biblionumber}, '300', 'Over-large bib record has the correct biblionumber (bug 11096)'); > like($newresults[0]->{notes}, qr/This is large note #550/, 'Able to render the notes field for over-large bib record (bug 11096)'); > >+ # notforloancount should be returned as part of searchResults output >+ ok( defined $newresults[0]->{notforloancount}, >+ '\'notforloancount\' defined in searchResults output (Bug 12419)'); >+ is( $newresults[0]->{notforloancount}, 2, >+ '\'notforloancount\' == 2 (Bug 12419)'); >+ > # verify that we don't attempt to sort if no results were returned > # because of a query error > warning_like {( undef, $results_hashref, $facets_loop ) = >@@ -914,12 +932,12 @@ sub run_unimarc_search_tests { > } > > subtest 'MARC21 + GRS-1' => sub { >- plan tests => 104; >+ plan tests => 106; > run_marc21_search_tests('grs1'); > }; > > subtest 'MARC21 + DOM' => sub { >- plan tests => 104; >+ plan tests => 106; > run_marc21_search_tests('dom'); > }; > >diff --git a/t/db_dependent/data/marc21/zebraexport/large_biblio_dom/exported_records.xml b/t/db_dependent/data/marc21/zebraexport/large_biblio_dom/exported_records.xml >index 36c8efa..4a58f86 100644 >--- a/t/db_dependent/data/marc21/zebraexport/large_biblio_dom/exported_records.xml >+++ b/t/db_dependent/data/marc21/zebraexport/large_biblio_dom/exported_records.xml >@@ -1659,6 +1659,18 @@ > <datafield tag="500" ind1=" " ind2=" "> > <subfield code="a">This is a note. This is a large note. This is note that is so large, the margins of this terminal window are not nearly wide enough to contain it. This is large note #550</subfield> > </datafield> >+ <datafield tag="952" ind1=" " ind2=" "> >+ <subfield code="p">aaabbb</subfield> >+ <subfield code="7">1</subfield> >+ </datafield> >+ <datafield tag="952" ind1=" " ind2=" "> >+ <subfield code="p">bbbccc</subfield> >+ <subfield code="7">0</subfield> >+ </datafield> >+ <datafield tag="952" ind1=" " ind2=" "> >+ <subfield code="p">cccddd</subfield> >+ <subfield code="7">1</subfield> >+ </datafield> > <datafield tag="999" ind1=" " ind2=" "> > <subfield code="c">300</subfield> > <subfield code="d">300</subfield> >diff --git a/t/db_dependent/data/marc21/zebraexport/large_biblio_grs1/exported_records.xml b/t/db_dependent/data/marc21/zebraexport/large_biblio_grs1/exported_records.xml >index 4305f7d..21cfa17 100644 >--- a/t/db_dependent/data/marc21/zebraexport/large_biblio_grs1/exported_records.xml >+++ b/t/db_dependent/data/marc21/zebraexport/large_biblio_grs1/exported_records.xml >@@ -1658,6 +1658,18 @@ > <datafield tag="500" ind1=" " ind2=" "> > <subfield code="a">This is a note. This is a large note. This is note that is so large, the margins of this terminal window are not nearly wide enough to contain it. This is large note #550</subfield> > </datafield> >+ <datafield tag="952" ind1=" " ind2=" "> >+ <subfield code="p">aaabbb</subfield> >+ <subfield code="7">1</subfield> >+ </datafield> >+ <datafield tag="952" ind1=" " ind2=" "> >+ <subfield code="p">bbbccc</subfield> >+ <subfield code="7">0</subfield> >+ </datafield> >+ <datafield tag="952" ind1=" " ind2=" "> >+ <subfield code="p">cccddd</subfield> >+ <subfield code="7">1</subfield> >+ </datafield> > <datafield tag="999" ind1=" " ind2=" "> > <subfield code="c">300</subfield> > <subfield code="d">300</subfield> >-- >1.9.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 12419
:
28838
|
28957
|
29135
|
29384
| 29385