API-DirectAdmin
view release on metacpan or search on metacpan
-- Add 'list' and 'deldb' methods to API::DirectAdmin::Mysql
-- rewrite all 'list' methods
0.05 Jan 28 2012 Andrey Kuzmin
-- Add POD descriptions for all methods with examples
0.04 Jan 27 2012 Andrey Kuzmin
-- rename query_abstract to query
0.03 Jan 27 2012 Andrey Kuzmin
-- Add FAKE_ANSWER for making tests
-- some little fixes
0.02 Jan 27 2012 Andrey Kuzmin
-- rewrite API to OO Structure
-- rewrite POD
-- rewtire tests
0.01 Nov 28 2011 Andrey Kuzmin
-- first version
lib/API/DirectAdmin.pm
lib/API/DirectAdmin/Ip.pm
lib/API/DirectAdmin/User.pm
lib/API/DirectAdmin/Domain.pm
lib/API/DirectAdmin/Mysql.pm
lib/API/DirectAdmin/DNS.pm
lib/API/DirectAdmin/Component.pm
Makefile.PL
MANIFEST This list of files
README
t/01-test.t
API-DirectAdmin
=======================
INSTALLATION
To install this module type the following:
perl Makefile.PL
make
make test
make install
DEPENDENCIES
This module requires these other modules and libraries:
Modern::Perl
LWP::UserAgent
HTTP::Request
URI
Carp
lib/API/DirectAdmin.pm view on Meta::CPAN
});
=back
=head1 INSTALLATION
To install this module type the following:
perl Makefile.PL
make
make test
make install
=head1 DEPENDENCIES
This module requires these other modules and libraries:
Modern::Perl
LWP::UserAgent
HTTP::Request
URI
Carp
t/01-test.t view on Meta::CPAN
use strict;
use warnings;
use lib qw( ./lib );
use Data::Dumper;
our $ONLINE;
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);
t/01-test.t view on Meta::CPAN
# User
use_ok('API::DirectAdmin::User');
my $result = $da->user->create(
{
username => $manipulate_user,
domain => 'zse1.ru',
passwd => 'qwerty',
passwd2 => 'qwerty',
email => 'test@example.com',
ip => '127.0.0.1',
package => 'newpackage',
}
);
is_deeply( $result, \%answer, 'API::DirectAdmin::User::create' );
%answer = (
text => 'Cannot Create Account',
error => 1,
details => 'That username already exists on the system'
);
$da->{fake_answer} = ! $ONLINE ? \%answer : undef;
$result = $da->user->create(
{
username => $manipulate_user,
domain => 'zse1.ru',
passwd => 'qwerty',
passwd2 => 'qwerty',
email => 'test@example.com',
ip => '127.0.0.1',
package => 'newpackage',
}
);
is_deeply( $result, \%answer, 'API::DirectAdmin::User::create repeat');
%answer = (
text => 'Password Changed',
error => 0,
details => 'Password successfully changed'
t/01-test.t view on Meta::CPAN
text => 'Success',
error => 0,
details => 'All selected Users have been suspended',
);
$da->{fake_answer} = ! $ONLINE ? \%answer : undef;
$result = $da->user->disable(
{
user => $manipulate_user,
reason => 'test reason1',
}
);
is_deeply( $result, \%answer, 'API::DirectAdmin::User::disable');
$da->{fake_answer} = ! $ONLINE ? \%answer : undef;
$result = $da->user->enable(
{
user => $manipulate_user,
}
( run in 0.442 second using v1.01-cache-2.11-cpan-87723dcf8b7 )