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

(-)a/t/db_dependent/Circulation_Issuingrule.t (-7 / +15 lines)
Lines 6-12 use DateTime; Link Here
6
use Koha::DateUtils;
6
use Koha::DateUtils;
7
use Koha::Library;
7
use Koha::Library;
8
8
9
use Test::More tests => 9;
9
use Test::More tests => 10;
10
10
11
BEGIN {
11
BEGIN {
12
    use_ok('C4::Circulation');
12
    use_ok('C4::Circulation');
Lines 113-119 my $sampleissuingrule1 = { Link Here
113
    maxissueqty        => 5,
113
    maxissueqty        => 5,
114
    maxonsiteissueqty  => 4,
114
    maxonsiteissueqty  => 4,
115
    finedays           => 0,
115
    finedays           => 0,
116
    lengthunit         => 'Null',
116
    lengthunit         => 'days',
117
    renewalperiod      => 5,
117
    renewalperiod      => 5,
118
    norenewalbefore    => 6,
118
    norenewalbefore    => 6,
119
    auto_renew         => 0,
119
    auto_renew         => 0,
Lines 148-154 my $sampleissuingrule2 = { Link Here
148
    auto_renew         => 0,
148
    auto_renew         => 0,
149
    reservesallowed    => 'Null',
149
    reservesallowed    => 'Null',
150
    issuelength        => 2,
150
    issuelength        => 2,
151
    lengthunit         => 'Null',
151
    lengthunit         => 'days',
152
    hardduedate        => 2,
152
    hardduedate        => 2,
153
    hardduedatecompare => 'Null',
153
    hardduedatecompare => 'Null',
154
    fine               => 'Null',
154
    fine               => 'Null',
Lines 179-185 my $sampleissuingrule3 = { Link Here
179
    auto_renew         => 0,
179
    auto_renew         => 0,
180
    reservesallowed    => 'Null',
180
    reservesallowed    => 'Null',
181
    issuelength        => 3,
181
    issuelength        => 3,
182
    lengthunit         => 'Null',
182
    lengthunit         => 'days',
183
    hardduedate        => 3,
183
    hardduedate        => 3,
184
    hardduedatecompare => 'Null',
184
    hardduedatecompare => 'Null',
185
    fine               => 'Null',
185
    fine               => 'Null',
Lines 340-346 is_deeply( Link Here
340
        $samplecat->{categorycode},
340
        $samplecat->{categorycode},
341
        'BOOK', $samplebranch1->{branchcode}
341
        'BOOK', $samplebranch1->{branchcode}
342
    ),
342
    ),
343
    { issuelength => 5, lengthunit => 'Null', renewalperiod => 5 },
343
    { issuelength => 5, lengthunit => 'days', renewalperiod => 5 },
344
    "GetLoanLength"
344
    "GetLoanLength"
345
);
345
);
346
is_deeply(
346
is_deeply(
Lines 377-384 is_deeply( Link Here
377
        renewalperiod => 21,
377
        renewalperiod => 21,
378
        lengthunit    => 'days',
378
        lengthunit    => 'days',
379
    },
379
    },
380
    "With only one parameter, GetLoanLength returns hardcoded values"
380
    "With only two parameters, GetLoanLength returns hardcoded values"
381
);    #NOTE : is that really what is expected?
381
);    #NOTE : is that really what is expected?
382
is_deeply(
383
    C4::Circulation::GetLoanLength( $samplecat->{categorycode}, 'BOOK', $samplebranch1->{branchcode} ),
384
    {
385
        issuelength   => 5,
386
        renewalperiod => 5,
387
        lengthunit    => 'days',
388
    },
389
    "With the correct number of parameters, GetLoanLength returns the expected values"
390
);
382
391
383
#Test GetHardDueDate
392
#Test GetHardDueDate
384
my @hardduedate = C4::Circulation::GetHardDueDate( $samplecat->{categorycode},
393
my @hardduedate = C4::Circulation::GetHardDueDate( $samplecat->{categorycode},
385
- 

Return to bug 15757