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