[
  {
    "path": ".gitignore",
    "content": "composer.lock\n/vendor\n"
  },
  {
    "path": ".travis.yml",
    "content": "language: php\nphp:\n- 5.6\n- 7.4\n- 7.1\nbefore_script:\n- composer self-update\n- composer install --prefer-source --no-interaction\nscript:\n- vendor/bin/phpunit\n\n"
  },
  {
    "path": "LICENSE",
    "content": "The MIT License (MIT)\n\nCopyright (c) <2014> <Mochamad Gufron>\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n"
  },
  {
    "path": "README.md",
    "content": "## cPanel/WHM API for PHP library\n\n## Contents\n- [Installation Guide](#installation-guide)\n- [Usage](#usage)\n- [Functions](#functions)\n- [Feedback & Contribution](#feedback-&-contribution)\n\n### Installation Guide\n\nTo install this package, you can run this code via your terminal\n```shell\n\tcomposer require gufy/cpanel-php:~2.0\n```\nOr update your `composer.json` by adding this line\n```json\n\t\"gufy/cpanel-php\":\"~2.0\"\n```\n\nThen, run this code\n```shell\n\tcomposer update\n```\n\n### Usage\n\nFor example, if you would like to get list accounts of your whm server, you can do this.\n\n```php\n  <?php\n  $cpanel = new \\Gufy\\CpanelPhp\\Cpanel([\n      'host'        =>  'https://123.456.789.123:2087', // ip or domain complete with its protocol and port\n      'username'    =>  'root', // username of your server, it usually root.\n      'auth_type'   =>  'hash', // set 'hash' or 'password'\n      'password'    =>  'password', // long hash or your user's password\n  ]);\n\n  $accounts = $cpanel->listaccts(); // it will returned as array\n\n```\n\n### Functions\n\n- [Defining Configuration on constructor](#defining-configuration-on-constructor)\n- [Usage](#usage)\n- [Overriding Current configuration](#overriding-current-configuration)\n- [Get defined configuration](#get-defined-configuration)\n\n#### Defining Configuration on constructor\nThis is the example when you want to define your configuration while creating new object\n\n```php\n  <?php\n  $cpanel = new \\Gufy\\CpanelPhp\\Cpanel([\n      'host'        =>  'https://123.456.789.123:2087', // required\n      'username'    =>  'root', // required\n      'auth_type'   =>  'hash', // optional, default 'hash'\n      'password'    =>  'password', // required\n  ]);\n```\n\n#### Usage\nFor example, you would like to get some list accounts from cPanel/WHM\n```php\n\t<?php\n\n\t$accounts = $cpanel->listaccts();\n\n\t// passing parameters\n\t$accounts = $cpanel->listaccts(['searchtype'=>'domain', 'search'=>'', 'exact', 'search'=>'helloworld.com']);\n\t\n\t// create account (Domain Name, Username, Password, Plan Slug)\n\tcreateAccount(www.domain_name.com.br, 'user', 'pass', 'plan_basic');\n```\n\nFor accessing cPanel API 2, you can use this.\n\n```php\n\t<?php\n\t// get bandwidth data of specific cPanel's user\n\t$data = $cpanel->cpanel('Bandwidth', 'getbwdata', 'username');\n\n\t// removing cron line\n\t$data = $cpanel->cpanel('Cron', 'remove_line', 'username', ['line'=>1]);\n```\n\nThe first parameter must be Module you would like to get, second is function name, and the third is username of cPanel's user. There is fourth arguments, when function has some additional arguments, you can pass it there.\n\nFor accessing to cPanel API 1 or cPanel API 2 or UAPI, you can use this.\n\n```php\n\t<?php\n\t// get bandwidth data of specific cPanel's user (using cPanel API 2)\n\t$data = $cpanel->execute_action('2', 'Bandwidth', 'getbwdata', 'username');\n\n\t// removing email address (using UAPI)\n\t$data = $cpanel->execute_action('3', 'Email', 'delete_pop', 'username', ['email'=>'peter@griffin.com']);\n```\n\nThis function is similar to the above, the only difference is that it has added a parameter which indicates the API you want to use (1 = cPanel API 1, 2 = cPanel API 2, 3 = UAPI), the other arguments are the same.\n\n#### Overriding current configuration\nSomehow, you want to override your current configuration. To do this, here is the code\n\n```php\n  <?php\n  // change username andd (password or hash)\n  $cpanel->setAuthorization($username, $password);\n\n  // change host\n  $cpanel->setHost($host);\n\n  // change authentication type\n  $cpanel->setAuthType($auth_type);\n```\n\n#### Get defined configuration\nAfter you define some of your configuration, you can get it again by calling this functions\n\n```php\n  <?php\n  // get username\n  $cpanel->getUsername();\n\n  // get password\n  $cpanel->getPassword();\n\n  // get authentication type\n  $cpanel->getAuthType();\n\n  // get host\n  $cpanel->getHost();\n```\n\n#### Feedback and contribution\n\nThis package is free and open source, feel free to fork and report some issue to this package. :-). Have fun\n"
  },
  {
    "path": "VERSION",
    "content": "1.0.5\n"
  },
  {
    "path": "composer.json",
    "content": "{\n    \"name\": \"gufy/cpanel-php\",\n    \"description\": \"Cpanel/WHM API for PHP\",\n    \"license\": \"MIT\",\n    \"authors\": [\n        {\n            \"name\": \"Mochamad Gufron\",\n            \"email\": \"mgufronefendi@gmail.com\"\n        }\n    ],\n    \"require\": {\n        \"php\": \">=5.6.0\",\n        \"guzzlehttp/guzzle\":\"~6\"\n    },\n    \"require-dev\": {\n        \"phpunit/phpunit\": \"^4.8\"\n    },\n    \"autoload\": {\n        \"psr-0\": {\n            \"Gufy\\\\CpanelPhp\\\\\": \"src/\"\n        }\n    },\n    \"minimum-stability\": \"stable\"\n}\n"
  },
  {
    "path": "phpunit.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<phpunit backupGlobals=\"false\"\n         backupStaticAttributes=\"false\"\n         bootstrap=\"vendor/autoload.php\"\n         colors=\"true\"\n         convertErrorsToExceptions=\"true\"\n         convertNoticesToExceptions=\"true\"\n         convertWarningsToExceptions=\"true\"\n         processIsolation=\"false\"\n         stopOnFailure=\"false\"\n         syntaxCheck=\"false\"\n>\n    <testsuites>\n        <testsuite name=\"Package Test Suite\">\n            <directory suffix=\".php\">./tests/</directory>\n        </testsuite>\n    </testsuites>\n</phpunit>\n"
  },
  {
    "path": "src/Gufy/CpanelPhp/Cpanel.php",
    "content": "<?php namespace Gufy\\CpanelPhp;\n\nuse GuzzleHttp\\Client;\n\n/**\n * cPanel/WHM API\n *\n * Provides easy to use class for calling some CPanel/WHM API functions.\n *\n * @author Mochamad Gufron <mgufronefendi@gmail.com>\n *\n * @version v1.0.2\n *\n * @link https://github.com/mgufrone/cpanel-php\n * @since v1.0.0\n */\nclass Cpanel implements CpanelInterface\n{\n    use CpanelShortcuts;\n\n    /**\n     * @var string Username of your whm server. Must be string\n     *\n     * @since v1.0.0\n     */\n    private $username;\n\n    /**\n     * @var string Password or long hash of your whm server.\n     *\n     * @since v1.0.0\n     */\n    private $password;\n\n    /**\n     * @var string Authentication type you want to use. You can set as 'hash' or 'password'.\n     *\n     * @since v1.0.0\n     */\n    private $auth_type;\n\n    /**\n     * @var string Host of your whm server. You must set it with full host with its port and protocol.\n     *\n     * @since v1.0.0\n     */\n    private $host;\n\n    /**\n     * @var string Sets of headers that will be sent at request.\n     *\n     * @since v1.0.0\n     */\n    protected $headers = array();\n\n    /**\n     * @var integer Query timeout (Guzzle option)\n     *\n     * @since v1.0.0\n     */\n    protected $timeout = 10;\n\n    /**\n     * @var integer Connection timeout (Guzzle option)\n     *\n     * @since v1.0.0\n     */\n    protected $connection_timeout = 2;\n\n    /**\n     * Class constructor. The options must be contain username, host, and password.\n     *\n     * @param array $options options that will be passed and processed\n     *\n     * @return self\n     * @since v1.0.0\n     */\n    public function __construct($options = array())\n    {\n        if (!empty($options)) {\n            if (!empty($options['auth_type'])) {\n                $this->setAuthType($options['auth_type']);\n            }\n\n            return $this->checkOptions($options)\n                ->setHost($options['host'])\n                ->setAuthorization($options['username'], $options['password']);\n        }\n    }\n\n    /**\n     * Magic method who will call the CPanel/WHM Api.\n     *\n     * @param string $function function name that will be called\n     * @param array $arguments parameter that should be passed when calling API function\n     *\n     * @return array result of called functions\n     *\n     * @since v1.0.0\n     */\n    public function __call($function, $arguments)\n    {\n        if (count($arguments) > 0)\n            $arguments = $arguments[0];\n        return $this->runQuery($function, $arguments);\n    }\n\n    /**\n     * checking options for 'username', 'password', and 'host'. If they are not set, some exception will be thrown.\n     *\n     * @param array $options list of options that will be checked\n     *\n     * @return self\n     * @throws \\Exception\n     * @since v1.0.0\n     */\n    private function checkOptions($options)\n    {\n        if (empty($options['username'])) {\n            throw new \\Exception('Username is not set', 2301);\n        }\n        if (empty($options['password'])) {\n            throw new \\Exception('Password or hash is not set', 2302);\n        }\n        if (empty($options['host'])) {\n            throw new \\Exception('CPanel Host is not set', 2303);\n        }\n\n        return $this;\n    }\n\n    /**\n     * set authorization for access.\n     * It only set 'username' and 'password'.\n     *\n     * @param string $username Username of your whm server.\n     * @param string $password Password or long hash of your whm server.\n     *\n     * @return object return as self-object\n     *\n     * @since v1.0.0\n     */\n    public function setAuthorization($username, $password)\n    {\n        $this->username = $username;\n        $this->password = $password;\n\n        return $this;\n    }\n\n    /**\n     * set API Host.\n     *\n     * @param string $host Host of your whm server.\n     *\n     * @return object return as self-object\n     *\n     * @since v1.0.0\n     */\n    public function setHost($host)\n    {\n        $this->host = $host;\n\n        return $this;\n    }\n\n    /**\n     * set Authentication Type.\n     *\n     * @param string $auth_type Authentication type for calling API.\n     *\n     * @return object return as self-object\n     *\n     * @since v1.0.0\n     */\n    public function setAuthType($auth_type)\n    {\n        $this->auth_type = $auth_type;\n\n        return $this;\n    }\n\n    /**\n     * set some header.\n     *\n     * @param string $name key of header you want to add\n     * @param string $value value of header you want to add\n     *\n     * @return object return as self-object\n     *\n     * @since v1.0.0\n     */\n    public function setHeader($name, $value = '')\n    {\n        $this->headers[$name] = $value;\n\n        return $this;\n    }\n\n    /**\n     * set timeout.\n     *\n     * @param $timeout\n     *\n     * @return object return as self-object\n     *\n     * @since v1.0.0\n     */\n    public function setTimeout($timeout)\n    {\n        $this->timeout = (int) $timeout;\n\n        return $this;\n    }\n\n    /**\n     * set connection timeout.\n     *\n     * @param $connection_timeout\n     *\n     * @return object return as self-object\n     *\n     * @since v1.0.0\n     */\n    public function setConnectionTimeout($connection_timeout)\n    {\n        $this->connection_timeout = (int) $connection_timeout;\n\n        return $this;\n    }\n\n    /**\n     * get username.\n     *\n     * @return string return username\n     *\n     * @since v1.0.0\n     */\n    public function getUsername()\n    {\n        return $this->username;\n    }\n\n    /**\n     * get authentication type.\n     *\n     * @return string get authentication type\n     *\n     * @since v1.0.0\n     */\n    public function getAuthType()\n    {\n        return $this->auth_type;\n    }\n\n    /**\n     * get password or long hash.\n     *\n     * @return string get password or long hash\n     *\n     * @since v1.0.0\n     */\n    public function getPassword()\n    {\n        return $this->password;\n    }\n\n    /**\n     * get host of your whm server.\n     *\n     * @return string host of your whm server\n     *\n     * @since v1.0.0\n     */\n    public function getHost()\n    {\n        return $this->host;\n    }\n\n    /**\n     * get timeout.\n     *\n     * @return integer timeout of the Guzzle request\n     *\n     * @since v1.0.0\n     */\n    public function getTimeout()\n    {\n        return $this->timeout;\n    }\n\n    /**\n     * get connection timeout.\n     *\n     * @return integer connection timeout of the Guzzle request\n     *\n     * @since v1.0.0\n     */\n    public function getConnectionTimeout()\n    {\n        return $this->connection_timeout;\n    }\n\n    /**\n     * Extend HTTP headers that will be sent.\n     *\n     * @return array list of headers that will be sent\n     *\n     * @since v1.0.0\n     */\n    private function createHeader()\n    {\n        $headers = $this->headers;\n\n        $username = $this->getUsername();\n        $auth_type = $this->getAuthType();\n\n        if ('hash' == $auth_type) {\n            $headers['Authorization'] = 'WHM ' . $username . ':' . preg_replace(\"'(\\r|\\n|\\s|\\t)'\", '', $this->getPassword());\n        } elseif ('password' == $auth_type) {\n            $headers['Authorization'] = 'Basic ' . base64_encode($username . ':' .$this->getPassword());\n        }\n        return $headers;\n    }\n\n    /**\n     * The executor. It will run API function and get the data.\n     *\n     * @param string $action function name that will be called.\n     * @param array $arguments list of parameters that will be attached.\n     * @param bool   $throw defaults to false, if set to true rethrow every exception.\n     *\n     * @throws Exception|GuzzleHttp\\Exception\\ClientException\n     *\n     * @return array results of API call\n     *\n     * @since v1.0.0\n     */\n    protected function runQuery($action, $arguments = [], $throw = false)\n    {\n        $host = $this->getHost();\n        $client = new Client(['base_uri' => $host]);\n        try{\n          $response = $client->post('/json-api/' . $action, [\n              'headers' => $this->createHeader(),\n              'verify' => false,\n              'query' => $arguments,\n              'timeout' => $this->getTimeout(),\n              'connect_timeout' => $this->getConnectionTimeout()\n          ]);\n\n            if (($decodedBody = json_decode($response->getBody(), true)) === false) {\n                throw new \\Exception(json_last_error_msg(), json_last_error());\n            }\n\n            return $decodedBody;\n        }\n        catch(\\GuzzleHttp\\Exception\\ClientException $e)\n        {\n          if ($throw) {\n            throw $e; \n          }\n          return $e->getMessage();\n        }\n    }\n\n    /**\n     * Use a cPanel API\n     *\n     * @param $module\n     * @param $function\n     * @param $username\n     * @param array $params\n     * @return mixed\n     * @throws \\Exception\n     */\n    public function cpanel($module, $function, $username, $params = array())\n    {\n        $action = 'cpanel';\n        $params = array_merge($params, [\n            'cpanel_jsonapi_version' => 2,\n            'cpanel_jsonapi_module' => $module,\n            'cpanel_jsonapi_func' => $function,\n            'cpanel_jsonapi_user' => $username,\n        ]);\n\n        $response = $this->runQuery($action, $params);\n        return $response;\n    }\n\n    /**\n     * Use cPanel API 1 or use cPanel API 2 or use UAPI.\n     *\n     * @param $api (1 = cPanel API 1, 2 = cPanel API 2, 3 = UAPI)\n     * @param $module\n     * @param $function\n     * @param $username\n     * @param array $params\n     * @return mixed\n     * @throws \\Exception\n     */\n    public function execute_action($api, $module, $function, $username, $params = array())\n    {\n        $action = 'cpanel';\n        $params = array_merge($params, [\n            'cpanel_jsonapi_apiversion' => $api,\n            'cpanel_jsonapi_module' => $module,\n            'cpanel_jsonapi_func' => $function,\n            'cpanel_jsonapi_user' => $username,\n        ]);\n        $response = $this->runQuery($action, $params);\n\n        return $response;\n    }\n}\n"
  },
  {
    "path": "src/Gufy/CpanelPhp/CpanelInterface.php",
    "content": "<?php\nnamespace Gufy\\CpanelPhp;\n\n\n/**\n * cPanel/WHM API\n *\n * Provides easy to use class for calling some CPanel/WHM API functions.\n *\n * @author Mochamad Gufron <mgufronefendi@gmail.com>\n *\n * @version v1.0.2\n *\n * @link https://github.com/mgufrone/cpanel-php\n * @since v1.0.0\n */\ninterface CpanelInterface\n{\n    /**\n     * set authorization for access.\n     * It only set 'username' and 'password'.\n     *\n     * @param string $username Username of your whm server.\n     * @param string $password Password or long hash of your whm server.\n     *\n     * @return object return as self-object\n     *\n     * @since v1.0.0\n     */\n    public function setAuthorization($username, $password);\n\n    /**\n     * set API Host.\n     *\n     * @param string $host Host of your whm server.\n     *\n     * @return object return as self-object\n     *\n     * @since v1.0.0\n     */\n    public function setHost($host);\n\n    /**\n     * set Authentication Type.\n     *\n     * @param string $auth_type Authentication type for calling API.\n     *\n     * @return object return as self-object\n     *\n     * @since v1.0.0\n     */\n    public function setAuthType($auth_type);\n\n    /**\n     * set some header.\n     *\n     * @param string $name key of header you want to add\n     * @param string $value value of header you want to add\n     *\n     * @return object return as self-object\n     *\n     * @since v1.0.0\n     */\n    public function setHeader($name, $value = '');\n\n    /**\n     * get username.\n     *\n     * @return string return username\n     *\n     * @since v1.0.0\n     */\n    public function getUsername();\n\n    /**\n     * get authentication type.\n     *\n     * @return string get authentication type\n     *\n     * @since v1.0.0\n     */\n    public function getAuthType();\n\n    /**\n     * get password or long hash.\n     *\n     * @return string get password or long hash\n     *\n     * @since v1.0.0\n     */\n    public function getPassword();\n\n    /**\n     * get host of your whm server.\n     *\n     * @return string host of your whm server\n     *\n     * @since v1.0.0\n     */\n    public function getHost();\n\n    /**\n     * Use a cPanel API\n     *\n     * @param $module\n     * @param $function\n     * @param $username\n     * @param array $params\n     * @return mixed\n     * @throws \\Exception\n     */\n    public function cpanel($module, $function, $username, $params = array());\n}"
  },
  {
    "path": "src/Gufy/CpanelPhp/CpanelShortcuts.php",
    "content": "<?php namespace Gufy\\CpanelPhp;\n\n/**\n * Trait CpanelShortcuts\n *\n * A handful of shortcuts for getting things done(tm)\n *\n * @package Gufy\\CpanelWhm\n */\ntrait CpanelShortcuts\n{\n    /**\n     * List all the accounts that the reseller has access to.\n     *\n     * @return mixed\n     */\n    public function listAccounts()\n    {\n        return $this->runQuery('listaccts', []);\n    }\n\n    /**\n     * Create a new account\n     *\n     * @param $domain_name\n     * @param $username\n     * @param $password\n     * @param $plan\n     *\n     * @return mixed\n     */\n    public function createAccount($domain_name, $username, $password, $plan)\n    {\n        return $this->runQuery('createacct', [\n            'username' => $username,\n            'domain' => $domain_name,\n            'password' => $password,\n            'plan' => $plan,\n        ]);\n    }\n\n    /**\n     * This function deletes a cPanel or WHM account.\n     *\n     * @param string $username\n     */\n    public function destroyAccount($username)\n    {\n        return $this->runQuery('removeacct', [\n            'username' => $username,\n        ]);\n    }\n\n    /**\n     * Gets the email addresses that exist under a cPanel account\n     *\n     * @param $username\n     */\n    public function listEmailAccounts($username)\n    {\n        return $this->cpanel('Email', 'listpops', $username);\n    }\n    \n    /**\n     * Gets the forwarders that exist under a cPanel account\n     *\n     * @param $username\n     */\n    public function listForwards($username)\n    {\n        return $this->cpanel('Email', 'listforwards', $username);\n    }\n\n    /**\n     * @param $username **cPanel username**\n     * @param $email email address to add\n     * @param $password password **for the email address**\n     * @return mixed\n     * @throws \\Exception\n     */\n    public function addEmailAccount($username, $email, $password)\n    {\n        list($account, $domain) = $this->split_email($email);\n\n        return $this->emailAction('addpop', $username, $password, $domain, $account);\n    }\n\n    /**\n     * Change the password for an email account in cPanel\n     *\n     * @param $username\n     * @param $email\n     * @param $password\n     * @return mixed\n     * @throws \\Exception\n     */\n    public function changeEmailPassword($username, $email, $password)\n    {\n        list($account, $domain) = $this->split_email($email);\n\n        return $this->emailAction('passwdpop', $username, $password, $domain, $account);\n    }\n\n    /**\n     * Runs a blank API Request to pull cPanel's response.\n     *\n     * @return array [status (0 is fail, 1 is success), error (internal error code), verbose (Extended error message)]\n     */\n    public function checkConnection()\n    {\n        try {\n            $this->runQuery('', [], true);\n        } catch (\\Exception $e) {\n            if ($e->hasResponse()) {\n                switch ($e->getResponse()->getStatusCode()) {\n                    case 403:\n                        return [\n                            'status' => 0,\n                            'error' => 'auth_error',\n                            'verbose' => 'Check Username and Password/Access Key.'\n                        ];\n                    default:\n                        return [\n                            'status' => 0,\n                            'error' => 'unknown',\n                            'verbose' => 'An unknown error has occurred. Server replied with: ' . $e->getResponse()->getStatusCode()\n                        ];\n                }\n            } else {\n                return [\n                    'status' => 0,\n                    'error' => 'conn_error',\n                    'verbose' => 'Check CSF or hostname/port.'\n                ];\n            }\n            return false;\n        }\n\n        return [\n            'status' => 1,\n            'error' => false,\n            'verbose' => 'Everything is working.'\n        ];\n    }\n\n    /**\n     * Split an email address into two items, username and host.\n     *\n     * @param $email\n     * @return array\n     * @throws \\Exception\n     */\n    private function split_email($email)\n    {\n        $email_parts = explode('@', $email);\n        if (count($email_parts) !== 2) {\n            throw new \\Exception(\"Email account is not valid.\");\n        }\n\n        return $email_parts;\n    }\n\n    /**\n     * Perform an email action\n     *\n     * @param $action\n     * @param $username\n     * @param $password\n     * @param $domain\n     * @param $account\n     * @return mixed\n     */\n    private function emailAction($action, $username, $password, $domain, $account)\n    {\n        return $this->cpanel('Email', $action, $username, [\n            'domain' => $domain,\n            'email' => $account,\n            'password' => $password,\n        ]);\n    }\n}\n"
  },
  {
    "path": "tests/.gitignore",
    "content": "PrivateTest.php\n"
  },
  {
    "path": "tests/CpanelTest.php",
    "content": "<?php\nuse Gufy\\CpanelPhp\\Cpanel;\nclass CpanelTest extends PHPUnit_Framework_TestCase\n{\n  public function testConfiguration()\n  {\n    $cpanel = new Cpanel($options=array(\n      'host'=>'https://127.0.0.1:2087',\n      'username'=>'root',\n      'password'=>'password',\n      'auth_type'=>'password'\n    ));\n\n    $this->assertEquals($options['host'], $cpanel->getHost());\n    $this->assertEquals($options['username'], $cpanel->getUsername());\n    $this->assertEquals($options['password'], $cpanel->getPassword());\n    $this->assertEquals($options['auth_type'], $cpanel->getAuthType());\n  }\n\n}\n"
  }
]