View | Details | Raw Unified | Return to bug 29719
Collapse All | Expand All

(-)a/t/db_dependent/Items.t (-2 / +19 lines)
Lines 1019-1025 subtest 'Split subfields in Item2Marc (Bug 21774)' => sub { Link Here
1019
};
1019
};
1020
1020
1021
subtest 'ModItemFromMarc' => sub {
1021
subtest 'ModItemFromMarc' => sub {
1022
    plan tests => 6;
1022
    plan tests => 7;
1023
    $schema->storage->txn_begin;
1023
    $schema->storage->txn_begin;
1024
1024
1025
    my $builder = t::lib::TestBuilder->new;
1025
    my $builder = t::lib::TestBuilder->new;
Lines 1075-1080 subtest 'ModItemFromMarc' => sub { Link Here
1075
        is( $item->get_from_storage->cn_sort, 'YYY', 'cn_sort has been updated' );
1075
        is( $item->get_from_storage->cn_sort, 'YYY', 'cn_sort has been updated' );
1076
    };
1076
    };
1077
1077
1078
    subtest 'onloan' => sub {
1079
        plan tests => 3;
1080
1081
        my $item = $builder->build_sample_item;
1082
        $item->set({ onloan => '2022-03-19' })->store;
1083
        is( $item->onloan, '2022-03-19', 'init values set are expected' );
1084
1085
        my $marc = C4::Items::Item2Marc( $item->get_from_storage->unblessed, $item->biblionumber );
1086
        my ( $MARCfield, $MARCsubfield ) = GetMarcFromKohaField( 'items.onloan' );
1087
        $marc->field($MARCfield)->delete_subfield( code => $MARCsubfield );
1088
        ModItemFromMarc( $marc, $item->biblionumber, $item->itemnumber );
1089
        is( $item->get_from_storage->onloan, '2022-03-19', 'onloan has not been updated if not passed' );
1090
1091
        $marc = C4::Items::Item2Marc( { %{$item->unblessed}, onloan => '2022-03-26' }, $item->biblionumber );
1092
        ModItemFromMarc( $marc, $item->biblionumber, $item->itemnumber );
1093
        is( $item->get_from_storage->onloan, '2022-03-26', 'onloan has been updated when passed in' );
1094
    };
1095
1078
    subtest 'permanent_location' => sub {
1096
    subtest 'permanent_location' => sub {
1079
        plan tests => 10;
1097
        plan tests => 10;
1080
1098
1081
- 

Return to bug 29719