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

(-)a/t/db_dependent/Items.t (-2 / +19 lines)
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 => 6;
984
    plan tests => 7;
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 1037-1042 subtest 'ModItemFromMarc' => sub { Link Here
1037
        is( $item->get_from_storage->cn_sort, 'YYY', 'cn_sort has been updated' );
1037
        is( $item->get_from_storage->cn_sort, 'YYY', 'cn_sort has been updated' );
1038
    };
1038
    };
1039
1039
1040
    subtest 'onloan' => sub {
1041
        plan tests => 3;
1042
1043
        my $item = $builder->build_sample_item;
1044
        $item->set({ onloan => '2022-03-19' })->store;
1045
        is( $item->onloan, '2022-03-19', 'init values set are expected' );
1046
1047
        my $marc = C4::Items::Item2Marc( $item->get_from_storage->unblessed, $item->biblionumber );
1048
        my ( $MARCfield, $MARCsubfield ) = GetMarcFromKohaField( 'items.onloan' );
1049
        $marc->field($MARCfield)->delete_subfield( code => $MARCsubfield );
1050
        ModItemFromMarc( $marc, $item->biblionumber, $item->itemnumber );
1051
        is( $item->get_from_storage->onloan, '2022-03-19', 'onloan has not been updated if not passed' );
1052
1053
        $marc = C4::Items::Item2Marc( { %{$item->unblessed}, onloan => '2022-03-26' }, $item->biblionumber );
1054
        ModItemFromMarc( $marc, $item->biblionumber, $item->itemnumber );
1055
        is( $item->get_from_storage->onloan, '2022-03-26', 'onloan has been updated when passed in' );
1056
    };
1057
1040
    subtest 'permanent_location' => sub {
1058
    subtest 'permanent_location' => sub {
1041
        plan tests => 10;
1059
        plan tests => 10;
1042
1060
1043
- 

Return to bug 29719