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

(-)a/t/db_dependent/SIP/Transaction.t (-2 / +18 lines)
Lines 5-10 Link Here
5
5
6
use Modern::Perl;
6
use Modern::Perl;
7
use Test::More tests => 17;
7
use Test::More tests => 17;
8
use Test::Warn;
8
9
9
use Koha::Database;
10
use Koha::Database;
10
use t::lib::TestBuilder;
11
use t::lib::TestBuilder;
Lines 974-986 subtest checkin_withdrawn => sub { Link Here
974
};
975
};
975
976
976
subtest _get_sort_bin => sub {
977
subtest _get_sort_bin => sub {
977
    plan tests => 5;
978
    plan tests => 6;
978
979
979
    my $library  = $builder->build_object( { class => 'Koha::Libraries' } );
980
    my $library  = $builder->build_object( { class => 'Koha::Libraries' } );
980
    my $branch   = $library->branchcode;
981
    my $branch   = $library->branchcode;
981
    my $library2 = $builder->build_object( { class => 'Koha::Libraries' } );
982
    my $library2 = $builder->build_object( { class => 'Koha::Libraries' } );
982
    my $branch2  = $library2->branchcode;
983
    my $branch2  = $library2->branchcode;
983
984
985
    # Rules starts with malformed line, empty line and a comment to prove they are skipped
984
    my $rules = <<"RULES";
986
    my $rules = <<"RULES";
985
$branch:homebranch:ne:\$holdingbranch:X\r
987
$branch:homebranch:ne:\$holdingbranch:X\r
986
$branch:effective_itemtype:eq:CD:0\r
988
$branch:effective_itemtype:eq:CD:0\r
Lines 991-997 $branch2:homebranch:ne:\$holdingbranch:X\r Link Here
991
$branch2:effective_itemtype:eq:CD:4\r
993
$branch2:effective_itemtype:eq:CD:4\r
992
$branch2:itemcallnumber:>:600:5\r
994
$branch2:itemcallnumber:>:600:5\r
993
$branch2:effective_itemtype:eq:BOOK:ccode:eq:TEEN:6\r
995
$branch2:effective_itemtype:eq:BOOK:ccode:eq:TEEN:6\r
996
# Comment line to skip\r
997
\r
998
$branch:homebranch:Z\r
994
RULES
999
RULES
1000
995
    t::lib::Mocks::mock_preference( 'SIP2SortBinMapping', $rules );
1001
    t::lib::Mocks::mock_preference( 'SIP2SortBinMapping', $rules );
996
1002
997
    my $item_cd = $builder->build_sample_item(
1003
    my $item_cd = $builder->build_sample_item(
Lines 1017-1022 RULES Link Here
1017
        }
1023
        }
1018
    );
1024
    );
1019
1025
1026
    my $item_dvd = $builder->build_sample_item(
1027
        {
1028
            library => $library2->branchcode,
1029
            itype  => 'DVD'
1030
        }
1031
    );
1032
1020
    my $bin;
1033
    my $bin;
1021
1034
1022
    # Set holdingbranch as though item returned to library other than homebranch (As AddReturn would)
1035
    # Set holdingbranch as though item returned to library other than homebranch (As AddReturn would)
Lines 1036-1041 RULES Link Here
1036
1049
1037
    $bin = C4::SIP::ILS::Transaction::Checkin::_get_sort_bin( $item_book2, $library2->branchcode );
1050
    $bin = C4::SIP::ILS::Transaction::Checkin::_get_sort_bin( $item_book2, $library2->branchcode );
1038
    is( $bin, '6', "Rules with multiple field matches" );
1051
    is( $bin, '6', "Rules with multiple field matches" );
1052
1053
    warnings_are { $bin = C4::SIP::ILS::Transaction::Checkin::_get_sort_bin( $item_dvd, $library2->branchcode ); }
1054
    ["Malformed preference line found: 'qqVZrsgWK:homebranch:Z'"],
1055
        "Comments and blank lines are skipped, Malformed lines are warned and skipped";
1039
};
1056
};
1040
1057
1041
subtest item_circulation_status => sub {
1058
subtest item_circulation_status => sub {
1042
- 

Return to bug 34737