|
Lines 12-18
use YAML;
Link Here
|
| 12 |
use C4::Debug; |
12 |
use C4::Debug; |
| 13 |
require C4::Context; |
13 |
require C4::Context; |
| 14 |
|
14 |
|
| 15 |
use Test::More tests => 224; |
15 |
use Test::More tests => 232; |
| 16 |
use Test::MockModule; |
16 |
use Test::MockModule; |
| 17 |
use MARC::Record; |
17 |
use MARC::Record; |
| 18 |
use File::Spec; |
18 |
use File::Spec; |
|
Lines 41-46
sub index_sample_records_and_launch_zebra {
Link Here
|
| 41 |
system("zebraidx -c $datadir/etc/koha/zebradb/$zebra_bib_cfg -v none,fatal,warn -g iso2709 -d biblios update $sourcedir/${marc_type}/zebraexport/biblio"); |
41 |
system("zebraidx -c $datadir/etc/koha/zebradb/$zebra_bib_cfg -v none,fatal,warn -g iso2709 -d biblios update $sourcedir/${marc_type}/zebraexport/biblio"); |
| 42 |
system("zebraidx -c $datadir/etc/koha/zebradb/$zebra_bib_cfg -v none,fatal,warn -g iso2709 -d biblios commit"); |
42 |
system("zebraidx -c $datadir/etc/koha/zebradb/$zebra_bib_cfg -v none,fatal,warn -g iso2709 -d biblios commit"); |
| 43 |
} |
43 |
} |
|
|
44 |
# ... and add large bib records, if present |
| 45 |
if (-f "$sourcedir/${marc_type}/zebraexport/large_biblio_${indexing_mode}/exported_records.xml") { |
| 46 |
my $zebra_bib_cfg = ($indexing_mode eq 'dom') ? 'zebra-biblios-dom.cfg' : 'zebra-biblios.cfg'; |
| 47 |
system("zebraidx -c $datadir/etc/koha/zebradb/$zebra_bib_cfg -v none,fatal,warn -g marcxml -d biblios update $sourcedir/${marc_type}/zebraexport/large_biblio_${indexing_mode}"); |
| 48 |
system("zebraidx -c $datadir/etc/koha/zebradb/$zebra_bib_cfg -v none,fatal,warn -g marcxml -d biblios commit"); |
| 49 |
} |
| 44 |
if (-f "$sourcedir/${marc_type}/zebraexport/authority/exported_records") { |
50 |
if (-f "$sourcedir/${marc_type}/zebraexport/authority/exported_records") { |
| 45 |
my $zebra_auth_cfg = ($indexing_mode eq 'dom') ? 'zebra-authorities-dom.cfg' : 'zebra-authorities.cfg'; |
51 |
my $zebra_auth_cfg = ($indexing_mode eq 'dom') ? 'zebra-authorities-dom.cfg' : 'zebra-authorities.cfg'; |
| 46 |
system("zebraidx -c $datadir/etc/koha/zebradb/$zebra_auth_cfg -v none,fatal,warn -g iso2709 -d authorities init"); |
52 |
system("zebraidx -c $datadir/etc/koha/zebradb/$zebra_auth_cfg -v none,fatal,warn -g iso2709 -d authorities init"); |
|
Lines 227-233
sub run_marc21_search_tests {
Link Here
|
| 227 |
'020' => { |
233 |
'020' => { |
| 228 |
'sfs' => { 'a' => [ [ 'biblioitems', 'isbn' ] ] }, |
234 |
'sfs' => { 'a' => [ [ 'biblioitems', 'isbn' ] ] }, |
| 229 |
'list' => [ [ 'a', 'biblioitems', 'isbn' ] ] |
235 |
'list' => [ [ 'a', 'biblioitems', 'isbn' ] ] |
| 230 |
} |
236 |
}, |
|
|
237 |
'500' => { |
| 238 |
'sfs' => { 'a' => [ [ 'biblioitems', 'notes' ] ] }, |
| 239 |
'list' => [ [ 'a', 'biblioitems', 'notes' ] ] |
| 240 |
}, |
| 231 |
} |
241 |
} |
| 232 |
); |
242 |
); |
| 233 |
return \%hash; |
243 |
return \%hash; |
|
Lines 499-505
sub run_marc21_search_tests {
Link Here
|
| 499 |
$stopwords_removed, $query_type ) = buildQuery([], [ 'pqf=@attr 1=_ALLRECORDS @attr 2=103 ""' ], [], [], [], 0, 'en'); |
509 |
$stopwords_removed, $query_type ) = buildQuery([], [ 'pqf=@attr 1=_ALLRECORDS @attr 2=103 ""' ], [], [], [], 0, 'en'); |
| 500 |
|
510 |
|
| 501 |
($error, $results_hashref, $facets_loop) = getRecords($query,$simple_query,[ ], [ 'biblioserver' ],20,0,undef,\%branches,\%itemtypes,$query_type,0); |
511 |
($error, $results_hashref, $facets_loop) = getRecords($query,$simple_query,[ ], [ 'biblioserver' ],20,0,undef,\%branches,\%itemtypes,$query_type,0); |
| 502 |
is($results_hashref->{biblioserver}->{hits}, 179, "getRecords on _ALLRECORDS PQF returned all records"); |
512 |
is($results_hashref->{biblioserver}->{hits}, 180, "getRecords on _ALLRECORDS PQF returned all records"); |
| 503 |
|
513 |
|
| 504 |
( $error, $query, $simple_query, $query_cgi, |
514 |
( $error, $query, $simple_query, $query_cgi, |
| 505 |
$query_desc, $limit, $limit_cgi, $limit_desc, |
515 |
$query_desc, $limit, $limit_cgi, $limit_desc, |
|
Lines 775-780
sub run_marc21_search_tests {
Link Here
|
| 775 |
); |
785 |
); |
| 776 |
is($count, 1, 'MARC21 authorities: one hit on match contains "沙士北亞威廉姆" (QP)'); |
786 |
is($count, 1, 'MARC21 authorities: one hit on match contains "沙士北亞威廉姆" (QP)'); |
| 777 |
|
787 |
|
|
|
788 |
# retrieve records that are larger than the MARC limit of 99,999 octets |
| 789 |
( undef, $results_hashref, $facets_loop ) = |
| 790 |
getRecords('ti:marc the large record', '', [], [ 'biblioserver' ], '20', 0, undef, \%branches, \%itemtypes, 'ccl', undef); |
| 791 |
is($results_hashref->{biblioserver}->{hits}, 1, "can do a search that retrieves an over-large bib record (bug 11096)"); |
| 792 |
@newresults = searchResults('opac', $query_desc, $results_hashref->{'biblioserver'}->{'hits'}, 10, 0, 0, |
| 793 |
$results_hashref->{'biblioserver'}->{"RECORDS"}); |
| 794 |
is($newresults[0]->{title}, 'Marc the Large Record', 'able to render over-large bib record (bug 11096)'); |
| 795 |
is($newresults[0]->{biblionumber}, '300', 'able to render over-large bib record (bug 11096)'); |
| 796 |
like($newresults[0]->{notes}, qr/This is large note #550/, 'able to render over-large bib record (bug 11096)'); |
| 778 |
|
797 |
|
| 779 |
cleanup(); |
798 |
cleanup(); |
| 780 |
} |
799 |
} |
| 781 |
- |
|
|