use Koha::DateUtils;
use Koha::Library;
-use Test::More tests => 9;
+use Test::More tests => 10;
BEGIN {
use_ok('C4::Circulation');
maxissueqty => 5,
maxonsiteissueqty => 4,
finedays => 0,
- lengthunit => 'Null',
+ lengthunit => 'days',
renewalperiod => 5,
norenewalbefore => 6,
auto_renew => 0,
auto_renew => 0,
reservesallowed => 'Null',
issuelength => 2,
- lengthunit => 'Null',
+ lengthunit => 'days',
hardduedate => 2,
hardduedatecompare => 'Null',
fine => 'Null',
auto_renew => 0,
reservesallowed => 'Null',
issuelength => 3,
- lengthunit => 'Null',
+ lengthunit => 'days',
hardduedate => 3,
hardduedatecompare => 'Null',
fine => 'Null',
$samplecat->{categorycode},
'BOOK', $samplebranch1->{branchcode}
),
- { issuelength => 5, lengthunit => 'Null', renewalperiod => 5 },
+ { issuelength => 5, lengthunit => 'days', renewalperiod => 5 },
"GetLoanLength"
);
is_deeply(
renewalperiod => 21,
lengthunit => 'days',
},
- "With only one parameter, GetLoanLength returns hardcoded values"
+ "With only two parameters, GetLoanLength returns hardcoded values"
); #NOTE : is that really what is expected?
+is_deeply(
+ C4::Circulation::GetLoanLength( $samplecat->{categorycode}, 'BOOK', $samplebranch1->{branchcode} ),
+ {
+ issuelength => 5,
+ renewalperiod => 5,
+ lengthunit => 'days',
+ },
+ "With the correct number of parameters, GetLoanLength returns the expected values"
+);
#Test GetHardDueDate
my @hardduedate = C4::Circulation::GetHardDueDate( $samplecat->{categorycode},