|
Lines 1-7
Link Here
|
| 1 |
#!/usr/bin/perl |
1 |
#!/usr/bin/perl |
| 2 |
|
2 |
|
| 3 |
use Modern::Perl; |
3 |
use Modern::Perl; |
| 4 |
use Test::More tests => 3; |
4 |
use Test::More tests => 4; |
| 5 |
|
5 |
|
| 6 |
use C4::Branch; |
6 |
use C4::Branch; |
| 7 |
use C4::Context; |
7 |
use C4::Context; |
|
Lines 45-47
$dbh->do(q|
Link Here
|
| 45 |
|
45 |
|
| 46 |
@overdue_branches = C4::Overdues::GetBranchcodesWithOverdueRules; |
46 |
@overdue_branches = C4::Overdues::GetBranchcodesWithOverdueRules; |
| 47 |
is_deeply( \@overdue_branches, ['CPL'] , 'If only a specific rule exist, only 1 branch should be returned' ); |
47 |
is_deeply( \@overdue_branches, ['CPL'] , 'If only a specific rule exist, only 1 branch should be returned' ); |
| 48 |
- |
48 |
|
|
|
49 |
$dbh->do(q|DELETE FROM overduerules|); |
| 50 |
$dbh->do(q| |
| 51 |
INSERT INTO overduerules |
| 52 |
( branchcode,categorycode, delay1,letter1,debarred1, delay2,letter2,debarred2, delay3,letter3,debarred3 ) |
| 53 |
VALUES |
| 54 |
( 'CPL', '', 1, 'LETTER_CODE1_CPL', 1, 5, 'LETTER_CODE2_CPL', 1, 10, 'LETTER_CODE3_CPL', 1 ), |
| 55 |
( 'MPL', '', 1, 'LETTER_CODE1_MPL', 1, 5, 'LETTER_CODE2_MPL', 1, 10, 'LETTER_CODE3_MPL', 1 ) |
| 56 |
|); |
| 57 |
|
| 58 |
@overdue_branches = C4::Overdues::GetBranchcodesWithOverdueRules; |
| 59 |
is_deeply( \@overdue_branches, ['CPL', 'MPL'] , 'If only 2 specific rules exist, 2 branches should be returned' ); |