Exemplo n.º 1
0
 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]);
 }
Exemplo n.º 2
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]);
 }
Exemplo n.º 3
0
 /**
  * @expectedException Omines\DirectAdmin\DirectAdminException
  */
 public function testInvalidUrl()
 {
     $admin = DirectAdmin::connectAdmin('http://www.google.com/', 'username', 'password');
     $admin->getContextUser()->getType();
 }
Exemplo n.º 4
0
 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);
 }
Exemplo n.º 5
0
 /**
  * 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]);
 }
Exemplo n.º 6
0
 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);
 }