|
Lines 467-479
ok(MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[0],'
Link Here
|
| 467 |
($error, $results_hashref, $facets_loop) = getRecords($query,$simple_query,[ ], [ 'biblioserver' ],20,0,\%branches,\%itemtypes,$query_type,0); |
467 |
($error, $results_hashref, $facets_loop) = getRecords($query,$simple_query,[ ], [ 'biblioserver' ],20,0,\%branches,\%itemtypes,$query_type,0); |
| 468 |
is($results_hashref->{biblioserver}->{hits}, 2, "getRecords generated availability-limited search matched right number of records"); |
468 |
is($results_hashref->{biblioserver}->{hits}, 2, "getRecords generated availability-limited search matched right number of records"); |
| 469 |
|
469 |
|
| 470 |
@newresults = searchResults({'interface'=>'opac'}, $query_desc, $results_hashref->{'biblioserver'}->{'hits'}, 17, 0, 0, |
470 |
{ |
| 471 |
$results_hashref->{'biblioserver'}->{"RECORDS"}); |
471 |
my $mock_items = Test::MockModule->new('Koha::Items'); |
| 472 |
my $allavailable = 'true'; |
472 |
$mock_items->mock( 'count', 1 ); |
| 473 |
foreach my $result (@newresults) { |
473 |
@newresults = searchResults({'interface'=>'opac'}, $query_desc, $results_hashref->{'biblioserver'}->{'hits'}, 17, 0, 0, |
| 474 |
$allavailable = 'false' unless $result->{availablecount} > 0; |
474 |
$results_hashref->{'biblioserver'}->{"RECORDS"}); |
|
|
475 |
my $allavailable = 'true'; |
| 476 |
foreach my $result (@newresults) { |
| 477 |
$allavailable = 'false' unless $result->{availablecount} > 0; |
| 478 |
} |
| 479 |
is ($allavailable, 'true', 'All records have at least one item available'); |
| 475 |
} |
480 |
} |
| 476 |
is ($allavailable, 'true', 'All records have at least one item available'); |
|
|
| 477 |
|
481 |
|
| 478 |
my $mocked_xslt = Test::MockModule->new('Koha::XSLT::Base'); |
482 |
my $mocked_xslt = Test::MockModule->new('Koha::XSLT::Base'); |
| 479 |
$mocked_xslt->mock( 'transform', sub { |
483 |
$mocked_xslt->mock( 'transform', sub { |
|
Lines 751-761
ok(MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[0],'
Link Here
|
| 751 |
( undef, $results_hashref, $facets_loop ) = |
755 |
( undef, $results_hashref, $facets_loop ) = |
| 752 |
getRecords('ti:marc the large record', '', [], [ 'biblioserver' ], '20', 0, \%branches, \%itemtypes, 'ccl', undef); |
756 |
getRecords('ti:marc the large record', '', [], [ 'biblioserver' ], '20', 0, \%branches, \%itemtypes, 'ccl', undef); |
| 753 |
is($results_hashref->{biblioserver}->{hits}, 1, "Can do a search that retrieves an over-large bib record (bug 11096)"); |
757 |
is($results_hashref->{biblioserver}->{hits}, 1, "Can do a search that retrieves an over-large bib record (bug 11096)"); |
| 754 |
@newresults = searchResults({'interface' =>'opac'}, $query_desc, $results_hashref->{'biblioserver'}->{'hits'}, 10, 0, 0, |
758 |
|
| 755 |
$results_hashref->{'biblioserver'}->{"RECORDS"}); |
759 |
{ |
| 756 |
is($newresults[0]->{title}, 'Marc the Large Record', 'Able to render the title for over-large bib record (bug 11096)'); |
760 |
my $mock_items = Test::MockModule->new('Koha::Items'); |
| 757 |
is($newresults[0]->{biblionumber}, '300', 'Over-large bib record has the correct biblionumber (bug 11096)'); |
761 |
$mock_items->mock( 'count', 1 ); |
| 758 |
like($newresults[0]->{notes}, qr/This is large note #550/, 'Able to render the notes field for over-large bib record (bug 11096)'); |
762 |
@newresults = searchResults({'interface' =>'opac'}, $query_desc, $results_hashref->{'biblioserver'}->{'hits'}, 10, 0, 0, |
|
|
763 |
$results_hashref->{'biblioserver'}->{"RECORDS"}); |
| 764 |
is($newresults[0]->{title}, 'Marc the Large Record', 'Able to render the title for over-large bib record (bug 11096)'); |
| 765 |
is($newresults[0]->{biblionumber}, '300', 'Over-large bib record has the correct biblionumber (bug 11096)'); |
| 766 |
like($newresults[0]->{notes}, qr/This is large note #550/, 'Able to render the notes field for over-large bib record (bug 11096)'); |
| 767 |
} |
| 759 |
|
768 |
|
| 760 |
# notforloancount should be returned as part of searchResults output |
769 |
# notforloancount should be returned as part of searchResults output |
| 761 |
ok( defined $newresults[0]->{notforloancount}, |
770 |
ok( defined $newresults[0]->{notforloancount}, |
| 762 |
- |
|
|