2015-12-07 01:20:14 +00:00
|
|
|
# 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;
|
|
|
|
|
2015-12-07 02:56:59 +00:00
|
|
|
use Test::More tests => 4;
|
|
|
|
use Test::Exception;
|
|
|
|
|
2015-12-07 01:20:14 +00:00
|
|
|
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");
|
2015-12-07 01:20:14 +00:00
|
|
|
|
2015-12-07 02:56:59 +00:00
|
|
|
|
|
|
|
=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();
|
2015-12-07 01:20:14 +00:00
|
|
|
|