add testsuite parameter to phpunit to respect our required test-order; minor fixes in Domains- and SubDomains Command
Signed-off-by: Michael Kaufmann (d00p) <d00p@froxlor.org>
This commit is contained in:
@@ -194,6 +194,8 @@
|
||||
taskname="phpunit">
|
||||
<arg value="--configuration" />
|
||||
<arg path="${basedir}/phpunit.xml" />
|
||||
<arg value="--testsuite" />
|
||||
<arg value="froxlor" />
|
||||
</exec>
|
||||
|
||||
<property name="phpunit.done" value="true" />
|
||||
@@ -205,6 +207,8 @@
|
||||
<exec executable="${phpunit}" failonerror="true" taskname="phpunit">
|
||||
<arg value="--configuration" />
|
||||
<arg path="${basedir}/phpunit.xml" />
|
||||
<arg value="--testsuite" />
|
||||
<arg value="froxlor" />
|
||||
<arg value="--no-coverage" />
|
||||
</exec>
|
||||
|
||||
|
||||
@@ -706,7 +706,6 @@ class Domains extends ApiCommand implements ResourceEntity
|
||||
Database::pexecute($ins_stmt, $ins_data, true, true);
|
||||
$domainid = Database::lastInsertId();
|
||||
$ins_data['id'] = $domainid;
|
||||
$domain_ins_data = $ins_data;
|
||||
unset($ins_data);
|
||||
|
||||
$upd_stmt = Database::prepare("
|
||||
@@ -747,7 +746,12 @@ class Domains extends ApiCommand implements ResourceEntity
|
||||
inserttask('4');
|
||||
|
||||
$this->logger()->logAction(ADM_ACTION, LOG_WARNING, "[API] added domain '" . $domain . "'");
|
||||
return $this->response(200, "successfull", $domain_ins_data);
|
||||
|
||||
$json_result = Domains::getLocal($this->getUserData(), array(
|
||||
'domainname' => $domain
|
||||
))->get();
|
||||
$result = json_decode($json_result, true)['data'];
|
||||
return $this->response(200, "successfull", $result);
|
||||
}
|
||||
}
|
||||
throw new Exception("No more resources available", 406);
|
||||
|
||||
@@ -330,7 +330,7 @@ class SubDomains extends ApiCommand implements ResourceEntity
|
||||
|
||||
$this->logger()->logAction($this->isAdmin() ? ADM_ACTION : USR_ACTION, LOG_INFO, "[API] added subdomain '" . $completedomain . "'");
|
||||
|
||||
$json_result = Subdomains::getLocal($this->getUserData(), array(
|
||||
$json_result = SubDomains::getLocal($this->getUserData(), array(
|
||||
'id' => $subdomain_id
|
||||
))->get();
|
||||
$result = json_decode($json_result, true)['data'];
|
||||
@@ -597,23 +597,9 @@ class SubDomains extends ApiCommand implements ResourceEntity
|
||||
inserttask('4');
|
||||
|
||||
// reduce subdomain-usage-counter
|
||||
$stmt = Database::prepare("
|
||||
UPDATE `" . TABLE_PANEL_CUSTOMERS . "`
|
||||
SET `subdomains_used` = `subdomains_used` - 1
|
||||
WHERE `customerid` = :customerid
|
||||
");
|
||||
Database::pexecute($stmt, array(
|
||||
"customerid" => $customer_id
|
||||
), true, true);
|
||||
Customers::decreaseUsage($customer_id, 'subdomains_used');
|
||||
// update admin usage
|
||||
$stmt = Database::prepare("
|
||||
UPDATE `" . TABLE_PANEL_ADMINS . "`
|
||||
SET `subdomains_used` = `subdomains_used` - 1
|
||||
WHERE `adminid` = :adminid
|
||||
");
|
||||
Database::pexecute($stmt, array(
|
||||
"adminid" => ($this->isAdmin() ? $customer['adminid'] : $this->getUserDetail('adminid'))
|
||||
), true, true);
|
||||
Admins::decreaseUsage(($this->isAdmin() ? $customer['adminid'] : $this->getUserDetail('adminid')), 'subdomains_used');
|
||||
|
||||
$this->logger()->logAction($this->isAdmin() ? ADM_ACTION : USR_ACTION, LOG_WARNING, "[API] deleted subdomain '" . $result['domain'] . "'");
|
||||
return $this->response(200, "successfull", $result);
|
||||
|
||||
@@ -11,8 +11,9 @@
|
||||
<directory>tests/Global</directory>
|
||||
<directory>tests/Admins</directory>
|
||||
<directory>tests/Customers</directory>
|
||||
<directory>tests/SubDomains</directory>
|
||||
<directory>tests/IpsAndPorts</directory>
|
||||
<directory>tests/Domains</directory>
|
||||
<directory>tests/SubDomains</directory>
|
||||
<directory>tests/Ftps</directory>
|
||||
</testsuite>
|
||||
</testsuites>
|
||||
|
||||
Reference in New Issue
Block a user