Lines 17-23
Link Here
|
17 |
|
17 |
|
18 |
use Modern::Perl; |
18 |
use Modern::Perl; |
19 |
|
19 |
|
20 |
use Test::More tests => 18; |
20 |
use Test::More tests => 19; |
21 |
use Test::Warn; |
21 |
use Test::Warn; |
22 |
|
22 |
|
23 |
use C4::Biblio qw( AddBiblio ModBiblio ModBiblioMarc ); |
23 |
use C4::Biblio qw( AddBiblio ModBiblio ModBiblioMarc ); |
Lines 588-593
subtest 'get_components_query' => sub {
Link Here
|
588 |
is($biblio->get_components_query, "(((rcn:$biblionumber AND cni:OSt) OR rcn:\"OSt $biblionumber\") AND (bib-level:a OR bib-level:b))", "UseControlNumber enabled with MarcOrgCode"); |
588 |
is($biblio->get_components_query, "(((rcn:$biblionumber AND cni:OSt) OR rcn:\"OSt $biblionumber\") AND (bib-level:a OR bib-level:b))", "UseControlNumber enabled with MarcOrgCode"); |
589 |
}; |
589 |
}; |
590 |
|
590 |
|
|
|
591 |
subtest 'get_volumes_query' => sub { |
592 |
plan tests => 3; |
593 |
|
594 |
my $biblio = $builder->build_sample_biblio(); |
595 |
my $biblionumber = $biblio->biblionumber; |
596 |
my $record = $biblio->metadata->record; |
597 |
|
598 |
t::lib::Mocks::mock_preference( 'UseControlNumber', '0' ); |
599 |
is($biblio->get_volumes_query, "ti,phr:(Some boring read)", "UseControlNumber disabled"); |
600 |
|
601 |
t::lib::Mocks::mock_preference( 'UseControlNumber', '1' ); |
602 |
my $marc_001_field = MARC::Field->new('001', $biblionumber); |
603 |
$record->append_fields($marc_001_field); |
604 |
C4::Biblio::ModBiblio( $record, $biblio->biblionumber ); |
605 |
$biblio = Koha::Biblios->find( $biblio->biblionumber); |
606 |
|
607 |
is($biblio->get_volumes_query, "rcn:$biblionumber NOT (bib-level:a OR bib-level:b)", "UseControlNumber enabled without MarcOrgCode"); |
608 |
|
609 |
my $marc_003_field = MARC::Field->new('003', 'OSt'); |
610 |
$record->append_fields($marc_003_field); |
611 |
C4::Biblio::ModBiblio( $record, $biblio->biblionumber ); |
612 |
$biblio = Koha::Biblios->find( $biblio->biblionumber); |
613 |
|
614 |
is($biblio->get_volumes_query, "((rcn:$biblionumber AND cni:OSt) OR rcn:OSt $biblionumber) NOT (bib-level:a OR bib-level:b)", "UseControlNumber enabled with MarcOrgCode"); |
615 |
}; |
616 |
|
591 |
subtest 'orders() and active_orders() tests' => sub { |
617 |
subtest 'orders() and active_orders() tests' => sub { |
592 |
|
618 |
|
593 |
plan tests => 5; |
619 |
plan tests => 5; |
594 |
- |
|
|