auto-format all files; add table-definitions to test-bootstrap file
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
This commit is contained in:
@@ -17,13 +17,13 @@ class DirOptionsTest extends TestCase
|
||||
public function testCustomerDirOptionsAdd()
|
||||
{
|
||||
global $admin_userdata;
|
||||
|
||||
|
||||
// get customer
|
||||
$json_result = Customers::getLocal($admin_userdata, array(
|
||||
'loginname' => 'test1'
|
||||
))->get();
|
||||
$customer_userdata = json_decode($json_result, true)['data'];
|
||||
|
||||
|
||||
$data = [
|
||||
'path' => '/test',
|
||||
'options_indexes' => 1,
|
||||
@@ -38,17 +38,17 @@ class DirOptionsTest extends TestCase
|
||||
$this->assertEquals('1', $result['options_cgi']);
|
||||
$this->assertEquals('/403.html', $result['error403path']);
|
||||
}
|
||||
|
||||
|
||||
public function testCustomerDirOptionsAddDuplicatePath()
|
||||
{
|
||||
global $admin_userdata;
|
||||
|
||||
|
||||
// get customer
|
||||
$json_result = Customers::getLocal($admin_userdata, array(
|
||||
'loginname' => 'test1'
|
||||
))->get();
|
||||
$customer_userdata = json_decode($json_result, true)['data'];
|
||||
|
||||
|
||||
$data = [
|
||||
'path' => '/test',
|
||||
'options_indexes' => 0,
|
||||
@@ -64,13 +64,13 @@ class DirOptionsTest extends TestCase
|
||||
public function testAdminDirOptionsGet()
|
||||
{
|
||||
global $admin_userdata;
|
||||
|
||||
|
||||
// get customer
|
||||
$json_result = Customers::getLocal($admin_userdata, array(
|
||||
'loginname' => 'test1'
|
||||
))->get();
|
||||
$customer_userdata = json_decode($json_result, true)['data'];
|
||||
|
||||
|
||||
$data = [
|
||||
'id' => 1,
|
||||
'loginname' => 'test1'
|
||||
@@ -79,7 +79,7 @@ class DirOptionsTest extends TestCase
|
||||
$result = json_decode($json_result, true)['data'];
|
||||
$this->assertEquals($customer_userdata['documentroot'] . 'test/', $result['path']);
|
||||
}
|
||||
|
||||
|
||||
public function testResellerDirOptionsGet()
|
||||
{
|
||||
global $admin_userdata;
|
||||
@@ -94,7 +94,7 @@ class DirOptionsTest extends TestCase
|
||||
'loginname' => 'test1'
|
||||
))->get();
|
||||
$customer_userdata = json_decode($json_result, true)['data'];
|
||||
|
||||
|
||||
$data = [
|
||||
'id' => 1,
|
||||
'loginname' => 'test1'
|
||||
@@ -103,17 +103,17 @@ class DirOptionsTest extends TestCase
|
||||
$result = json_decode($json_result, true)['data'];
|
||||
$this->assertEquals($customer_userdata['documentroot'] . 'test/', $result['path']);
|
||||
}
|
||||
|
||||
|
||||
public function testCustomerDirOptionsGetNotFound()
|
||||
{
|
||||
global $admin_userdata;
|
||||
|
||||
|
||||
// get customer
|
||||
$json_result = Customers::getLocal($admin_userdata, array(
|
||||
'loginname' => 'test1'
|
||||
))->get();
|
||||
$customer_userdata = json_decode($json_result, true)['data'];
|
||||
|
||||
|
||||
$data = [
|
||||
'id' => 1337
|
||||
];
|
||||
@@ -124,13 +124,13 @@ class DirOptionsTest extends TestCase
|
||||
public function testCustomerDirOptionsUpdate()
|
||||
{
|
||||
global $admin_userdata;
|
||||
|
||||
|
||||
// get customer
|
||||
$json_result = Customers::getLocal($admin_userdata, array(
|
||||
'loginname' => 'test1'
|
||||
))->get();
|
||||
$customer_userdata = json_decode($json_result, true)['data'];
|
||||
|
||||
|
||||
$data = [
|
||||
'id' => 1,
|
||||
'options_indexes' => 0,
|
||||
@@ -147,7 +147,7 @@ class DirOptionsTest extends TestCase
|
||||
public function testAdminDirOptionsList()
|
||||
{
|
||||
global $admin_userdata;
|
||||
|
||||
|
||||
// get customer
|
||||
$json_result = Customers::getLocal($admin_userdata, array(
|
||||
'loginname' => 'test1'
|
||||
@@ -159,27 +159,28 @@ class DirOptionsTest extends TestCase
|
||||
$this->assertEquals(1, $result['count']);
|
||||
$this->assertEquals($customer_userdata['documentroot'] . 'test/', $result['list'][0]['path']);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @depends testAdminDirOptionsList
|
||||
*/
|
||||
public function testCustomerDirOptionsDelete()
|
||||
{
|
||||
global $admin_userdata;
|
||||
|
||||
|
||||
// get customer
|
||||
$json_result = Customers::getLocal($admin_userdata, array(
|
||||
'loginname' => 'test1'
|
||||
))->get();
|
||||
$customer_userdata = json_decode($json_result, true)['data'];
|
||||
|
||||
|
||||
$data = [
|
||||
'id' => 1
|
||||
];
|
||||
$json_result = DirOptions::getLocal($customer_userdata, $data)->delete();
|
||||
$result = json_decode($json_result, true)['data'];
|
||||
$this->assertEquals($customer_userdata['documentroot'] . 'test/', $result['path']);
|
||||
|
||||
|
||||
$data = [
|
||||
'id' => 1
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user