From dba498c5287a49d3ffc642ae1ba5b7c0a877024a Mon Sep 17 00:00:00 2001 From: "Bradley M. Kuhn" Date: Thu, 7 Jan 2016 13:07:04 -0800 Subject: [PATCH] donorTotalGaveInPeriod: test badly formatted dates It should die if the dates aren't formatted right. --- Supporters/t/Supporters.t | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Supporters/t/Supporters.t b/Supporters/t/Supporters.t index 25b04cf..50268e2 100644 --- a/Supporters/t/Supporters.t +++ b/Supporters/t/Supporters.t @@ -841,6 +841,10 @@ dies_ok { $sp->donorTotalGaveInPeriod(donorId => undef); } "donorTotalGaveInPeri dies_ok { $sp->donorTotalGaveInPeriod(donorId => "str"); } "donorTotalGaveInPeriod(): dies with non-numeric donorId"; dies_ok { $sp->donorTotalGaveInPeriod(donorId => 0); } "donorTotalGaveInPeriod(): dies with non-existent id"; +foreach my $arg (qw/startDate endDate/) { + dies_ok { $sp->donorTotalGaveInPeriod(donorId => $drapperId, $arg => '2015-1-5'); } + "donorTotalGaveInPeriod(): dies with non ISO-8601 string in $arg"; +} my $amount; lives_ok { $amount = $sp->donorTotalGaveInPeriod(donorId => $drapperId) }