Bug 36128: (QA follow-up) Add regression test
This patch adds a simple regression test to ensure we don't re-introduce the errant warning. Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This commit is contained in:
parent
4c8586270a
commit
18c97c1456
1 changed files with 7 additions and 2 deletions
|
@ -1,7 +1,7 @@
|
|||
#!/usr/bin/perl;
|
||||
|
||||
use Modern::Perl;
|
||||
use Test::More tests => 17;
|
||||
use Test::More tests => 18;
|
||||
use Test::Warn;
|
||||
|
||||
use C4::Context;
|
||||
|
@ -84,6 +84,11 @@ is_deeply( $mtts, ['print', 'sms', 'email'], 'GetOverdueMessageTransportTypes: t
|
|||
|
||||
# Test GetBranchcodesWithOverdueRules
|
||||
$dbh->do(q|DELETE FROM overduerules|);
|
||||
|
||||
my @overdue_branches;
|
||||
warnings_are { @overdue_branches = C4::Overdues::GetBranchcodesWithOverdueRules(); } [],
|
||||
"No warnings thrown when no overdue rules exist";
|
||||
|
||||
$dbh->do(q|
|
||||
INSERT INTO overduerules
|
||||
( branchcode,categorycode, delay1,letter1,debarred1, delay2,letter2,debarred2, delay3,letter3,debarred3 )
|
||||
|
@ -93,7 +98,7 @@ $dbh->do(q|
|
|||
|
||||
my @branchcodes = map { $_->branchcode } Koha::Libraries->search->as_list;
|
||||
|
||||
my @overdue_branches = C4::Overdues::GetBranchcodesWithOverdueRules();
|
||||
@overdue_branches = C4::Overdues::GetBranchcodesWithOverdueRules();
|
||||
is_deeply( [ sort @overdue_branches ], [ sort @branchcodes ], 'If a default rule exists, all branches should be returned' );
|
||||
|
||||
$dbh->do(q|
|
||||
|
|
Loading…
Reference in a new issue