From 8fd03e8e6fc591fd7ce2bfd027ddd828a80e511b Mon Sep 17 00:00:00 2001 From: "Bradley M. Kuhn" Date: Sun, 13 Dec 2015 12:50:08 -0800 Subject: [PATCH] Fail causes on getRequestConfigurations. --- Supporters/lib/Supporters.pm | 26 ++++++++++++++++++++++++++ Supporters/t/Supporters.t | 11 ++++++++++- 2 files changed, 36 insertions(+), 1 deletion(-) diff --git a/Supporters/lib/Supporters.pm b/Supporters/lib/Supporters.pm index b6e3d65..c06c10e 100644 --- a/Supporters/lib/Supporters.pm +++ b/Supporters/lib/Supporters.pm @@ -260,6 +260,32 @@ sub addRequestType($$) { } ###################################################################### +=begin getRequestConfigurations + +Arguments: + +=over + +=item type + + A string describing the request_type. + +=back + +Returns undef if the request_type is not found in the database. If the reuqest type is +is no request of that type. + +=cut + +sub getRequestConfigurations($$) { + my($self, $type) = @_; + + return undef if not defined $type; + my $typeId = $self->getRequestType($type); + return undef if not defined $typeId; +} +###################################################################### + =head1 Non-Public Methods These methods are part of the internal implementation are not recommended for diff --git a/Supporters/t/Supporters.t b/Supporters/t/Supporters.t index 65c0d20..cefad95 100644 --- a/Supporters/t/Supporters.t +++ b/Supporters/t/Supporters.t @@ -5,7 +5,7 @@ use strict; use warnings; -use Test::More tests => 34; +use Test::More tests => 36; use Test::Exception; use Scalar::Util qw(looks_like_number); @@ -161,6 +161,15 @@ lives_ok { $testSameRequestType = $sp->addRequestType('t-shirt-0'); } is $requestTypeId, $testSameRequestType, "addRequestType: lookup first of existing request type before adding."; +=item getRequestConfigurations + +=cut + +is undef, $sp->getRequestConfigurations(undef), "getRequestConfigurations: undef type returns undef"; + +is undef, $sp->getRequestConfigurations('Hae2Ohlu'), "getRequestConfigurations: non-existent type returns undef"; + + =back =item Internal methods used only by the module itself.