supporters/Supporters/t/Supporters.t

40 lines
679 B
Perl
Raw Normal View History

# Before 'make install' is performed this script should be runnable with
# 'make test'. After 'make install' it should work as 'perl Supporters.t'
#########################
use strict;
use warnings;
use Test::More tests => 4;
use Test::Exception;
BEGIN { use_ok('Supporters') };
2015-12-07 02:28:49 +00:00
=pod
Initial tests to verify creation of objects
=cut
require 't/CreateTestDB.pl';
my $dbh = get_test_dbh();
2015-12-07 02:55:01 +00:00
my $sp = new Supporters($dbh, "testcmd");
2015-12-07 02:28:49 +00:00
2015-12-07 03:07:30 +00:00
is($dbh, $sp->dbh(), "verify dbh set");
is("testcmd", $sp->ledgerCmd(), "verify ledgerCmd set");
=pod
Test adding a supporter to the database.
=cut
dies_ok { $sp->addSupporter({}) } "ledger_entity_id required";
2015-12-07 02:28:49 +00:00
$dbh->disconnect();