initial commit
[Net-VoIP_Innovations.git] / t / lib / test_account.pl
1 use Test::More;
2
3 sub test_account_or_skip {
4     my($login, $password) = test_account();
5
6     unless( defined $login ) {
7         plan skip_all => "No test account";
8     }
9
10     return($login, $password);
11 }
12
13 sub test_account {
14     open TEST_ACCOUNT, "t/test_account" or return;
15     my($login, $password, $hostport) = <TEST_ACCOUNT>;
16     chomp $login;
17     chomp $password;
18     chomp $hostport;
19
20     if ( $hostport =~ /^\s*([\w\.]+)(:(\d+))?\s*$/ ) {
21       my($host, $port) = ($1, $3);
22       $Net::VoIP_Innovations::HOST = $host;
23       $Net::VoIP_Innovations::PORT = $port;
24     }
25
26     return($login, $password);
27 }
28
29 1;