test improvements and preparation for more tests later

Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
This commit is contained in:
Michael Kaufmann 2019-06-10 11:38:47 +02:00
parent 1ac304e5ac
commit 028524291e
No known key found for this signature in database
GPG Key ID: 55284EC83A4823B8
3 changed files with 9 additions and 3 deletions

View File

@ -9,7 +9,6 @@
<testsuite name="froxlor">
<!-- we need to specify the order of the tests for dependency-reasons -->
<directory>tests/Global</directory>
<directory>tests/Froxlor</directory>
<directory>tests/Admins</directory>
<directory>tests/Customers</directory>
<directory>tests/IpsAndPorts</directory>
@ -25,6 +24,7 @@
<directory>tests/Mysqls</directory>
<directory>tests/PhpAndFpm</directory>
<directory>tests/Traffic</directory>
<directory>tests/Froxlor</directory>
</testsuite>
</testsuites>

View File

@ -5,6 +5,7 @@ use Froxlor\Settings;
use Froxlor\Database\Database;
use Froxlor\Api\Commands\Admins;
use Froxlor\Api\Commands\Customers;
use Froxlor\Api\Commands\SubDomains;
/**
*
@ -58,6 +59,11 @@ class CustomersTest extends TestCase
$this->assertEquals(1337, $result['customernumber']);
$this->assertEquals(15, $result['subdomains']);
$this->assertEquals('secret', $result['custom_notes']);
// validate that the std-subdomain has been added
$json_result = SubDomains::getLocal($admin_userdata, array('id' => $result['standardsubdomain']))->get();
$result = json_decode($json_result, true)['data'];
$this->assertEquals('test1.dev.froxlor.org', $result['domain']);
}
public function testAdminCustomersAddEmptyMail()
@ -447,7 +453,7 @@ class CustomersTest extends TestCase
'mysqls' => 15,
'createstdsubdomain' => 1,
'new_customer_password' => 'h0lYmo1y',
'sendpassword' => 1,
'sendpassword' => TRAVIS_CI == 1 ? 0 : 1,
'phpenabled' => 1,
'store_defaultindex' => 1,
'custom_notes' => 'secret',

View File

@ -119,7 +119,7 @@ class DomainsTest extends TestCase
'customerid' => 1
];
$this->expectExceptionMessage('The server-hostname cannot be used as customer-domain.');
$json_result = Domains::getLocal($admin_userdata, $data)->add();
Domains::getLocal($admin_userdata, $data)->add();
}
public function testAdminDomainsAddNoPunycode()