Subject: | Dies when tested on default freshbooks accounts |
When you create a new Freshbooks account, you get one client (John
Smith, Sample Organization) by default. If you try to get a client list
without adding additional clients, your script will die:
Not an ARRAY reference at
/usr/local/share/perl/5.10.0/WWW/FreshBooks/API.pm line 100.
The following test will fail on a system with only one client:
#!/usr/bin/perl
use strict;
use warnings;
use Test::More qw( no_plan );
require_ok('WWW::FreshBooks::API');
my $conf = { ... };
my $fresh = WWW::FreshBooks::API->new({
svc_url => $conf->{'api_url'},
auth_token => $conf->{'auth_token'},
});
isa_ok( $fresh, 'WWW::FreshBooks::API' );
$fresh->call('client.list', {} );