Lines 943-949
subtest 'get_volumes_query' => sub {
Link Here
|
943 |
}; |
943 |
}; |
944 |
|
944 |
|
945 |
subtest 'generate_marc_host_field' => sub { |
945 |
subtest 'generate_marc_host_field' => sub { |
946 |
plan tests => 22; |
946 |
plan tests => 23; |
947 |
|
947 |
|
948 |
$schema->storage->txn_begin; |
948 |
$schema->storage->txn_begin; |
949 |
|
949 |
|
Lines 974-979
subtest 'generate_marc_host_field' => sub {
Link Here
|
974 |
is( $link->subfield('t'), 'Some boring read', 'MARC::Field->subfield(s) returns content from 245ab' ); |
974 |
is( $link->subfield('t'), 'Some boring read', 'MARC::Field->subfield(s) returns content from 245ab' ); |
975 |
is( $link->subfield('x'), '0317-8471', 'MARC::Field->subfield(s) returns content from 022a' ); |
975 |
is( $link->subfield('x'), '0317-8471', 'MARC::Field->subfield(s) returns content from 022a' ); |
976 |
is( $link->subfield('z'), undef, 'MARC::Field->subfield(s) returns undef when 020a is empty' ); |
976 |
is( $link->subfield('z'), undef, 'MARC::Field->subfield(s) returns undef when 020a is empty' ); |
|
|
977 |
is( $link->subfield('0'), $biblio->biblionumber, 'MARC::Field->subfield(s) returns content from 999$c' ); |
977 |
is( $link->subfield('w'), undef, 'MARC::Field->subfield(w) returns undef when "UseControlNumber" is disabled' ); |
978 |
is( $link->subfield('w'), undef, 'MARC::Field->subfield(w) returns undef when "UseControlNumber" is disabled' ); |
978 |
|
979 |
|
979 |
t::lib::Mocks::mock_preference( 'UseControlNumber', '1' ); |
980 |
t::lib::Mocks::mock_preference( 'UseControlNumber', '1' ); |
Lines 1019-1025
subtest 'generate_marc_host_field' => sub {
Link Here
|
1019 |
}; |
1020 |
}; |
1020 |
|
1021 |
|
1021 |
subtest 'link_marc_host' => sub { |
1022 |
subtest 'link_marc_host' => sub { |
1022 |
plan tests => 6; |
1023 |
plan tests => 8; |
1023 |
$schema->storage->txn_begin; |
1024 |
$schema->storage->txn_begin; |
1024 |
|
1025 |
|
1025 |
my $host = $builder->build_sample_biblio(); |
1026 |
my $host = $builder->build_sample_biblio(); |
Lines 1035-1040
subtest 'link_marc_host' => sub {
Link Here
|
1035 |
ref( $child_record->field('773') ), 'MARC::Field', |
1036 |
ref( $child_record->field('773') ), 'MARC::Field', |
1036 |
'773 field is set after calling link_marc_host({ host => $biblionumber })' |
1037 |
'773 field is set after calling link_marc_host({ host => $biblionumber })' |
1037 |
); |
1038 |
); |
|
|
1039 |
is( |
1040 |
$child_record->field('773')->subfield('0'), $host->biblionumber, |
1041 |
'773$0 is properly filled' |
1042 |
); |
1038 |
|
1043 |
|
1039 |
$child = $builder->build_sample_biblio(); |
1044 |
$child = $builder->build_sample_biblio(); |
1040 |
$child_record = $child->metadata->record; |
1045 |
$child_record = $child->metadata->record; |
Lines 1058-1063
subtest 'link_marc_host' => sub {
Link Here
|
1058 |
ref( $child_record->field('773') ), 'MARC::Field', |
1063 |
ref( $child_record->field('773') ), 'MARC::Field', |
1059 |
'773 field is set after calling link_marc_host({ field => $link_field })' |
1064 |
'773 field is set after calling link_marc_host({ field => $link_field })' |
1060 |
); |
1065 |
); |
|
|
1066 |
is( |
1067 |
$child_record->field('773')->subfield('0'), $host->biblionumber, |
1068 |
'773$0 is properly filled' |
1069 |
); |
1061 |
|
1070 |
|
1062 |
$schema->storage->txn_rollback; |
1071 |
$schema->storage->txn_rollback; |
1063 |
}; |
1072 |
}; |
1064 |
- |
|
|