public static function setUpBeforeClass() { self::$master = DirectAdmin::connectAdmin(DIRECTADMIN_URL, MASTER_ADMIN_USERNAME, MASTER_ADMIN_PASSWORD); $ips = self::$master->getIPs(); self::$user = self::$master->createUser(USER_USERNAME, USER_PASSWORD, TEST_EMAIL, TEST_USER_DOMAIN, $ips[0]); }
public function testDeleteAccounts() { // Have to separately delete the user as otherwise the order is not determined whether it's containing // reseller is removed first. Also - it implicitly tests both calls like this $adminContext = DirectAdmin::connectAdmin(DIRECTADMIN_URL, MASTER_ADMIN_USERNAME, MASTER_ADMIN_PASSWORD); $adminContext->deleteAccount(USER_USERNAME); $adminContext->deleteAccounts([RESELLER_USERNAME, ADMIN_USERNAME]); }
/** * @expectedException Omines\DirectAdmin\DirectAdminException */ public function testInvalidUrl() { $admin = DirectAdmin::connectAdmin('http://www.google.com/', 'username', 'password'); $admin->getContextUser()->getType(); }
public static function setUpBeforeClass() { self::$master = DirectAdmin::connectAdmin(DIRECTADMIN_URL, MASTER_ADMIN_USERNAME, MASTER_ADMIN_PASSWORD); self::$admin = self::$master->createAdmin(ADMIN_USERNAME, ADMIN_PASSWORD, TEST_EMAIL); }
/** * Invokes the DirectAdmin API via HTTP POST. * * @param string $command DirectAdmin API command to invoke * @param array $postParameters Optional form parameters * @return array The parsed and validated response */ public function invokePost($command, $postParameters = []) { return $this->connection->invoke('POST', $command, ['form_params' => $postParameters]); }
public static function setUpBeforeClass() { self::$master = DirectAdmin::connectAdmin(DIRECTADMIN_URL, MASTER_ADMIN_USERNAME, MASTER_ADMIN_PASSWORD); self::$reseller = self::$master->createReseller(RESELLER_USERNAME, RESELLER_PASSWORD, TEST_EMAIL, TEST_RESELLER_DOMAIN); }