API-PleskExpand

 view release on metacpan or  search on metacpan

t/TestData.pm  view on Meta::CPAN

use strict;
use warnings;

my $online_expand_url = 'https://your.true.host.ru:8442/webgate.php';

our %online_expand_valid_params = (
    api_version   => $ENV{'expand_api_version'}  || '2.2.4.1',
    username      => $ENV{'expand_username'}     || 'root',
    password      => $ENV{'expand_password'}     || 'qwerty',
    url           => $ENV{'expand_url'}          || $online_expand_url,
    debug         => '',
    request_debug => '',
);

t/expand.t  view on Meta::CPAN

$create_domain = API::PleskExpand::Domains::create( %new_domain_data, attach_to_template  => 1 );

is_string( $create_domain, $_, 'modify account test') for
'<add_use_template><gen_setup><name>y2a1ddsdfandex.ru</name>' .
'<client_id>16</client_id><status>0</status></gen_setup>'     .
'<hosting><vrt_hst><ftp_login>nrddgddsdasd</ftp_login>'       .
'<ftp_password>dadsdasd</ftp_password></vrt_hst></hosting>'   .
'<!-- create_domain --><tmpl_id>1</tmpl_id>'                  .
'<attach_to_template></attach_to_template></add_use_template>';

$expand_client->{dump_headers} = 1; # debugg =)

is_deeply(
    $expand_client->_execute_query('<add_use_template><!-- create_domain --></add_use_template>'),
    {
        ':HTTP_AUTH_LOGIN'  => $TestData::online_expand_valid_params{'username'},
        ':HTTP_AUTH_PASSWD' => $TestData::online_expand_valid_params{'password'},
        ':HTTP_AUTH_OP'     => 'exp_plesk_domain'
    },
    'test request headers'
);



( run in 1.460 second using v1.01-cache-2.11-cpan-49f99fa48dc )