update tests with new test accounts
[Business-OnlinePayment-AuthorizeNet.git] / t / lib / test_account.pl
1 sub test_account_or_skip {
2     my $suffix = shift;
3     my($login, $password) = test_account($suffix);
4
5     unless( defined $login ) {
6         plan skip_all => "No test account";
7     }
8
9     return($login, $password);
10 }
11
12 sub test_account {
13     my $suffix = shift || '';
14     $suffix = "_$suffix" if $suffix;
15     open TEST_ACCOUNT, "t/test_account$suffix" or return;
16     my($login, $password) = <TEST_ACCOUNT>;
17     chomp $login;
18     chomp $password;
19
20     return($login, $password);
21 }
22
23 sub expiration_date {
24     my($month, $year) = (localtime)[4,5];
25     $year++;       # So we expire next year.
26     $year %= 100;  # y2k?  What's that?
27
28     return sprintf("%02d/%02d", $month, $year);
29 }
30
31 1;