Lines 586-592
subtest 'get_components_query' => sub {
Link Here
|
586 |
$biblio = Koha::Biblios->find( $biblio->biblionumber); |
586 |
$biblio = Koha::Biblios->find( $biblio->biblionumber); |
587 |
|
587 |
|
588 |
( $comp_query, $comp_query_str, $comp_sort ) = $biblio->get_components_query; |
588 |
( $comp_query, $comp_query_str, $comp_sort ) = $biblio->get_components_query; |
589 |
is($comp_query_str, "(rcn:$biblionumber AND (bib-level:a OR bib-level:b))", "$engine: UseControlNumber enabled without MarcOrgCode"); |
589 |
is($comp_query_str, "(rcn:\"$biblionumber\" AND (bib-level:a OR bib-level:b))", "$engine: UseControlNumber enabled without MarcOrgCode"); |
590 |
is($comp_sort, "author_az", "$engine: UseControlNumber enabled without MarcOrgCode sort is correct"); |
590 |
is($comp_sort, "author_az", "$engine: UseControlNumber enabled without MarcOrgCode sort is correct"); |
591 |
|
591 |
|
592 |
my $marc_003_field = MARC::Field->new('003', 'OSt'); |
592 |
my $marc_003_field = MARC::Field->new('003', 'OSt'); |
Lines 597-603
subtest 'get_components_query' => sub {
Link Here
|
597 |
t::lib::Mocks::mock_preference( 'ComponentSortField', 'title' ); |
597 |
t::lib::Mocks::mock_preference( 'ComponentSortField', 'title' ); |
598 |
t::lib::Mocks::mock_preference( 'ComponentSortOrder', 'asc' ); |
598 |
t::lib::Mocks::mock_preference( 'ComponentSortOrder', 'asc' ); |
599 |
( $comp_query, $comp_query_str, $comp_sort ) = $biblio->get_components_query; |
599 |
( $comp_query, $comp_query_str, $comp_sort ) = $biblio->get_components_query; |
600 |
is($comp_query_str, "(((rcn:$biblionumber AND cni:OSt) OR rcn:\"OSt $biblionumber\") AND (bib-level:a OR bib-level:b))", "$engine: UseControlNumber enabled with MarcOrgCode"); |
600 |
is($comp_query_str, "(((rcn:\"$biblionumber\" AND cni:\"OSt\") OR rcn:\"OSt $biblionumber\") AND (bib-level:a OR bib-level:b))", "$engine: UseControlNumber enabled with MarcOrgCode"); |
601 |
is($comp_sort, "title_asc", "$engine: UseControlNumber enabled with MarcOrgCode sort if correct"); |
601 |
is($comp_sort, "title_asc", "$engine: UseControlNumber enabled with MarcOrgCode sort if correct"); |
602 |
$record->delete_field($marc_003_field); |
602 |
$record->delete_field($marc_003_field); |
603 |
} |
603 |
} |
604 |
- |
|
|