|
Lines 981-987
subtest 'Split subfields in Item2Marc (Bug 21774)' => sub {
Link Here
|
| 981 |
}; |
981 |
}; |
| 982 |
|
982 |
|
| 983 |
subtest 'ModItemFromMarc' => sub { |
983 |
subtest 'ModItemFromMarc' => sub { |
| 984 |
plan tests => 4; |
984 |
plan tests => 5; |
| 985 |
$schema->storage->txn_begin; |
985 |
$schema->storage->txn_begin; |
| 986 |
|
986 |
|
| 987 |
my $builder = t::lib::TestBuilder->new; |
987 |
my $builder = t::lib::TestBuilder->new; |
|
Lines 1021-1025
subtest 'ModItemFromMarc' => sub {
Link Here
|
| 1021 |
is( $updated_item->{new_status}, "this is something", "Non mapped field has not been reset" ); |
1021 |
is( $updated_item->{new_status}, "this is something", "Non mapped field has not been reset" ); |
| 1022 |
is( Koha::Items->find($itemnumber)->new_status, "this is something" ); |
1022 |
is( Koha::Items->find($itemnumber)->new_status, "this is something" ); |
| 1023 |
|
1023 |
|
|
|
1024 |
subtest 'cn_sort' => sub { |
| 1025 |
plan tests => 3; |
| 1026 |
|
| 1027 |
my $item = $builder->build_sample_item; |
| 1028 |
$item->set({ cn_source => 'ddc', itemcallnumber => 'xxx' })->store; |
| 1029 |
is( $item->cn_sort, 'XXX', 'init values set are expected' ); |
| 1030 |
|
| 1031 |
my $marc = C4::Items::Item2Marc( $item->get_from_storage->unblessed, $item->biblionumber ); |
| 1032 |
ModItemFromMarc( $marc, $item->biblionumber, $item->itemnumber ); |
| 1033 |
is( $item->get_from_storage->cn_sort, 'XXX', 'cn_sort has not been updated' ); |
| 1034 |
|
| 1035 |
$marc = C4::Items::Item2Marc( { %{$item->unblessed}, itemcallnumber => 'yyy' }, $item->biblionumber ); |
| 1036 |
ModItemFromMarc( $marc, $item->biblionumber, $item->itemnumber ); |
| 1037 |
is( $item->get_from_storage->cn_sort, 'YYY', 'cn_sort has been updated' ); |
| 1038 |
}; |
| 1039 |
|
| 1024 |
$schema->storage->txn_rollback; |
1040 |
$schema->storage->txn_rollback; |
| 1025 |
}; |
1041 |
}; |
| 1026 |
- |
|
|