API-DirectAdmin

 view release on metacpan or  search on metacpan

t/01-test.t  view on Meta::CPAN


BEGIN {
    #$ENV{auth_user}   = 'restest';
    #$ENV{auth_passwd} = '123';
    #$ENV{host}        = '192.168.123.1';
    $ONLINE = $ENV{auth_user} && $ENV{auth_passwd} && $ENV{host};
}

my $manipulate_user = 'zsezse';

use Test::More tests => $ONLINE ? 34 : 34;
my %connection_params = (
    host	=> $ENV{host} || '127.0.0.1',
    auth_user	=> $ENV{auth_user} || 'login',
    auth_passwd => $ENV{auth_passwd} || 'passwd',
);

ok(1, 'Test OK');
use_ok('API::DirectAdmin');

my $da = API::DirectAdmin->new(%connection_params);

my $func = 'filter_hash';
is_deeply( $da->filter_hash( {  }, [ ]), {}, $func );
is_deeply( $da->filter_hash( { aaa => 555, bbb => 111 }, [ 'aaa' ]), { aaa => 555 }, $func );
is_deeply( $da->filter_hash( { aaa => 555, bbb => 111 }, [ ]), { }, $func );
is_deeply( $da->filter_hash( { }, [ 'aaa' ]), { }, $func );



( run in 0.476 second using v1.01-cache-2.11-cpan-4d50c553e7e )