fix parameter for ApiCommand::getCustomerData()

Signed-off-by: Michael Kaufmann (d00p) <d00p@froxlor.org>
This commit is contained in:
Michael Kaufmann (d00p)
2018-03-12 10:57:31 +01:00
parent c920bf6a63
commit ff611fa8dc
10 changed files with 16 additions and 8 deletions

View File

@@ -35,7 +35,7 @@ class Ftps extends ApiCommand implements ResourceEntity
* optional if customer.ftpatdomain is allowed, specify an username * optional if customer.ftpatdomain is allowed, specify an username
* @param string $ftp_domain * @param string $ftp_domain
* optional if customer.ftpatdomain is allowed, specify a domain (customer must be owner) * optional if customer.ftpatdomain is allowed, specify a domain (customer must be owner)
* @param int $customer_id * @param int $customerid
* required when called as admin, not needed when called as customer * required when called as admin, not needed when called as customer
* *
* @access admin, customer * @access admin, customer

View File

@@ -41,7 +41,7 @@ class SubDomains extends ApiCommand implements ResourceEntity
* optional, whether to generate a https-redirect or not, default false; requires SSL to be enabled * optional, whether to generate a https-redirect or not, default false; requires SSL to be enabled
* @param bool $letsencrypt * @param bool $letsencrypt
* optional, whether to generate a Let's Encrypt certificate for this domain, default false; requires SSL to be enabled * optional, whether to generate a Let's Encrypt certificate for this domain, default false; requires SSL to be enabled
* @param int $customer_id * @param int $customerid
* required when called as admin, not needed when called as customer * required when called as admin, not needed when called as customer
* *
* @access admin, customer * @access admin, customer

View File

@@ -3,6 +3,7 @@ use PHPUnit\Framework\TestCase;
/** /**
* @covers ApiCommand * @covers ApiCommand
* @covers ApiParameter
* @covers Admins * @covers Admins
*/ */
class AdminsTest extends TestCase class AdminsTest extends TestCase

View File

@@ -3,6 +3,7 @@ use PHPUnit\Framework\TestCase;
/** /**
* @covers ApiCommand * @covers ApiCommand
* @covers ApiParameter
* @covers Certificates * @covers Certificates
*/ */
class CertificatesTest extends TestCase class CertificatesTest extends TestCase

View File

@@ -3,6 +3,7 @@ use PHPUnit\Framework\TestCase;
/** /**
* @covers ApiCommand * @covers ApiCommand
* @covers ApiParameter
* @covers Customers * @covers Customers
*/ */
class CustomersTest extends TestCase class CustomersTest extends TestCase

View File

@@ -3,6 +3,7 @@ use PHPUnit\Framework\TestCase;
/** /**
* @covers ApiCommand * @covers ApiCommand
* @covers ApiParameter
* @covers SubDomains * @covers SubDomains
* @covers Domains * @covers Domains
*/ */

View File

@@ -3,6 +3,7 @@ use PHPUnit\Framework\TestCase;
/** /**
* @covers ApiCommand * @covers ApiCommand
* @covers ApiParameter
* @covers Emails * @covers Emails
*/ */
class MailsTest extends TestCase class MailsTest extends TestCase

View File

@@ -3,6 +3,7 @@ use PHPUnit\Framework\TestCase;
/** /**
* @covers ApiCommand * @covers ApiCommand
* @covers ApiParameter
* @covers Ftps * @covers Ftps
*/ */
class FtpsTest extends TestCase class FtpsTest extends TestCase
@@ -170,8 +171,8 @@ class FtpsTest extends TestCase
'sendinfomail' => 1 'sendinfomail' => 1
]; ];
$this->expectExceptionCode(404); $this->expectExceptionCode(406);
$this->expectExceptionMessage('Requested parameter "customer_id" could not be found for "Ftps:add"'); $this->expectExceptionMessage('Requested parameter "loginname" is empty where it should not be for "Customers:get"');
$json_result = Ftps::getLocal($admin_userdata, $data)->add(); $json_result = Ftps::getLocal($admin_userdata, $data)->add();
} }
@@ -207,7 +208,7 @@ class FtpsTest extends TestCase
$customer_userdata = json_decode($json_result, true)['data']; $customer_userdata = json_decode($json_result, true)['data'];
$data = [ $data = [
'username' => 'test1ftp1', 'username' => 'test1ftp1',
'customer_id' => 1, 'customerid' => 1,
'ftp_password' => 'h4xXx0r2', 'ftp_password' => 'h4xXx0r2',
'path' => '/anotherfolder', 'path' => '/anotherfolder',
'ftp_description' => 'testing3' 'ftp_description' => 'testing3'
@@ -229,7 +230,7 @@ class FtpsTest extends TestCase
$customer_userdata = json_decode($json_result, true)['data']; $customer_userdata = json_decode($json_result, true)['data'];
$data = [ $data = [
'customer_id' => $customer_userdata['customerid'], 'customerid' => $customer_userdata['customerid'],
'ftp_password' => 'h4xXx0r', 'ftp_password' => 'h4xXx0r',
'path' => '/', 'path' => '/',
'ftp_description' => 'testing', 'ftp_description' => 'testing',

View File

@@ -3,6 +3,7 @@ use PHPUnit\Framework\TestCase;
/** /**
* @covers ApiCommand * @covers ApiCommand
* @covers ApiParameter
* @covers IpsAndPorts * @covers IpsAndPorts
*/ */
class IpsAndPortsTest extends TestCase class IpsAndPortsTest extends TestCase

View File

@@ -3,6 +3,7 @@ use PHPUnit\Framework\TestCase;
/** /**
* @covers ApiCommand * @covers ApiCommand
* @covers ApiParameter
* @covers SubDomains * @covers SubDomains
* @covers Domains * @covers Domains
*/ */
@@ -41,7 +42,7 @@ class SubDomainsTest extends TestCase
$data = [ $data = [
'subdomain' => 'mysub2', 'subdomain' => 'mysub2',
'domain' => 'test2.local', 'domain' => 'test2.local',
'customer_id' => 1 'customerid' => 1
]; ];
$json_result = SubDomains::getLocal($reseller_userdata, $data)->add(); $json_result = SubDomains::getLocal($reseller_userdata, $data)->add();
$result = json_decode($json_result, true)['data']; $result = json_decode($json_result, true)['data'];
@@ -161,7 +162,7 @@ class SubDomainsTest extends TestCase
'domainname' => 'mysub.test2.local', 'domainname' => 'mysub.test2.local',
'path' => 'mysub.test2.local', 'path' => 'mysub.test2.local',
'isemaildomain' => 1, 'isemaildomain' => 1,
'customer_id' => $customer_userdata['customerid'] 'customerid' => $customer_userdata['customerid']
]; ];
$json_result = SubDomains::getLocal($admin_userdata, $data)->update(); $json_result = SubDomains::getLocal($admin_userdata, $data)->update();
$result = json_decode($json_result, true)['data']; $result = json_decode($json_result, true)['data'];