Lines 17-23
Link Here
|
17 |
|
17 |
|
18 |
use Modern::Perl; |
18 |
use Modern::Perl; |
19 |
|
19 |
|
20 |
use Test::More tests => 16; |
20 |
use Test::More tests => 17; |
21 |
|
21 |
|
22 |
use C4::Biblio qw( AddBiblio ModBiblio ); |
22 |
use C4::Biblio qw( AddBiblio ModBiblio ); |
23 |
use Koha::Database; |
23 |
use Koha::Database; |
Lines 503-508
subtest 'suggestions() tests' => sub {
Link Here
|
503 |
$schema->storage->txn_rollback; |
503 |
$schema->storage->txn_rollback; |
504 |
}; |
504 |
}; |
505 |
|
505 |
|
|
|
506 |
subtest 'get_volumes_query' => sub { |
507 |
plan tests => 3; |
508 |
|
509 |
my $biblio = $builder->build_sample_biblio(); |
510 |
my $biblionumber = $biblio->biblionumber; |
511 |
my $record = $biblio->metadata->record; |
512 |
|
513 |
t::lib::Mocks::mock_preference( 'UseControlNumber', '0' ); |
514 |
is($biblio->get_volumes_query, "ti,phr:(Some boring read)", "UseControlNumber disabled"); |
515 |
|
516 |
t::lib::Mocks::mock_preference( 'UseControlNumber', '1' ); |
517 |
my $marc_001_field = MARC::Field->new('001', $biblionumber); |
518 |
$record->append_fields($marc_001_field); |
519 |
C4::Biblio::ModBiblio( $record, $biblio->biblionumber ); |
520 |
$biblio = Koha::Biblios->find( $biblio->biblionumber); |
521 |
|
522 |
is($biblio->get_volumes_query, "rcn:$biblionumber NOT (bib-level:a OR bib-level:b)", "UseControlNumber enabled without MarcOrgCode"); |
523 |
|
524 |
my $marc_003_field = MARC::Field->new('003', 'OSt'); |
525 |
$record->append_fields($marc_003_field); |
526 |
C4::Biblio::ModBiblio( $record, $biblio->biblionumber ); |
527 |
$biblio = Koha::Biblios->find( $biblio->biblionumber); |
528 |
|
529 |
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"); |
530 |
}; |
531 |
|
506 |
subtest 'orders() and active_orders() tests' => sub { |
532 |
subtest 'orders() and active_orders() tests' => sub { |
507 |
|
533 |
|
508 |
plan tests => 5; |
534 |
plan tests => 5; |
509 |
- |
|
|