Begin writing addSupporter method.

ledger_entity_id is required.
This commit is contained in:
Bradley M. Kuhn 2015-12-06 18:56:59 -08:00
parent 0fa986a76f
commit fc22b9a3cc
2 changed files with 18 additions and 1 deletions

View file

@ -43,6 +43,12 @@ sub dbh ($) {
sub ledgerCmd ($) {
return $_[0]->{ledgerCmd};
}
######################################################################
sub addSupporter ($) {
my($sp) = @_;
die "ledger_entity_id required" unless defined $sp->{ledger_entity_id};
}
1;

View file

@ -6,7 +6,9 @@
use strict;
use warnings;
use Test::More tests => 3;
use Test::More tests => 4;
use Test::Exception;
BEGIN { use_ok('Supporters') };
=pod
@ -24,5 +26,14 @@ my $sp = new Supporters($dbh, "testcmd");
is($dbh, $sp->dbh());
is("testcmd", $sp->ledgerCmd());
=pod
Test adding a supporter to the database.
=cut
dies_ok { $sp->addSupporter({}) } "ledger_entity_id required";
$dbh->disconnect();