Begin writing addSupporter method.
ledger_entity_id is required.
This commit is contained in:
parent
0fa986a76f
commit
fc22b9a3cc
2 changed files with 18 additions and 1 deletions
|
@ -43,6 +43,12 @@ sub dbh ($) {
|
||||||
sub ledgerCmd ($) {
|
sub ledgerCmd ($) {
|
||||||
return $_[0]->{ledgerCmd};
|
return $_[0]->{ledgerCmd};
|
||||||
}
|
}
|
||||||
|
######################################################################
|
||||||
|
sub addSupporter ($) {
|
||||||
|
my($sp) = @_;
|
||||||
|
|
||||||
|
die "ledger_entity_id required" unless defined $sp->{ledger_entity_id};
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
1;
|
1;
|
||||||
|
|
|
@ -6,7 +6,9 @@
|
||||||
use strict;
|
use strict;
|
||||||
use warnings;
|
use warnings;
|
||||||
|
|
||||||
use Test::More tests => 3;
|
use Test::More tests => 4;
|
||||||
|
use Test::Exception;
|
||||||
|
|
||||||
BEGIN { use_ok('Supporters') };
|
BEGIN { use_ok('Supporters') };
|
||||||
|
|
||||||
=pod
|
=pod
|
||||||
|
@ -24,5 +26,14 @@ my $sp = new Supporters($dbh, "testcmd");
|
||||||
is($dbh, $sp->dbh());
|
is($dbh, $sp->dbh());
|
||||||
is("testcmd", $sp->ledgerCmd());
|
is("testcmd", $sp->ledgerCmd());
|
||||||
|
|
||||||
|
|
||||||
|
=pod
|
||||||
|
|
||||||
|
Test adding a supporter to the database.
|
||||||
|
|
||||||
|
=cut
|
||||||
|
|
||||||
|
dies_ok { $sp->addSupporter({}) } "ledger_entity_id required";
|
||||||
|
|
||||||
$dbh->disconnect();
|
$dbh->disconnect();
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue