format composer.json and add php-7.0 as dev-requirement (phpunit6); add unit-test for Backup.add() when customer passes / as path value
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
This commit is contained in:
@@ -1,16 +1,18 @@
|
|||||||
{
|
{
|
||||||
"name" : "froxlor/froxlor",
|
"name" : "froxlor/froxlor",
|
||||||
"description" : "The server administration software for your needs. Developed by experienced server administrators, this panel simplifies the effort of managing your hosting platform.",
|
"description" : "The server administration software for your needs. Developed by experienced server administrators, this panel simplifies the effort of managing your hosting platform.",
|
||||||
"keywords": ["server", "administration", "php"],
|
"keywords" : [
|
||||||
|
"server",
|
||||||
|
"administration",
|
||||||
|
"php"
|
||||||
|
],
|
||||||
"homepage" : "https://www.froxlor.org",
|
"homepage" : "https://www.froxlor.org",
|
||||||
"license" : "GPL-2.0-or-later",
|
"license" : "GPL-2.0-or-later",
|
||||||
"authors": [
|
"authors" : [{
|
||||||
{
|
|
||||||
"name" : "Michael Kaufmann",
|
"name" : "Michael Kaufmann",
|
||||||
"email" : "team@froxlor.org",
|
"email" : "team@froxlor.org",
|
||||||
"role" : "Lead Developer"
|
"role" : "Lead Developer"
|
||||||
},
|
}, {
|
||||||
{
|
|
||||||
"name" : "Robert Förster",
|
"name" : "Robert Förster",
|
||||||
"email" : "team@froxlor.org",
|
"email" : "team@froxlor.org",
|
||||||
"role" : "Package Maintainer"
|
"role" : "Package Maintainer"
|
||||||
@@ -48,6 +50,7 @@
|
|||||||
"phploc/phploc" : "3.0.1",
|
"phploc/phploc" : "3.0.1",
|
||||||
"theseer/phpdox" : "0.11.2",
|
"theseer/phpdox" : "0.11.2",
|
||||||
"phpunit/php-invoker" : "1.1.4",
|
"phpunit/php-invoker" : "1.1.4",
|
||||||
|
"php" : ">=7.0",
|
||||||
"ext-pcntl" : "*"
|
"ext-pcntl" : "*"
|
||||||
},
|
},
|
||||||
"suggest" : {
|
"suggest" : {
|
||||||
|
|||||||
@@ -95,6 +95,28 @@ class CustomerBackupsTest extends TestCase
|
|||||||
$this->assertEquals('0', $result['backup_web']);
|
$this->assertEquals('0', $result['backup_web']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @depends testCustomerCustomerBackupsAdd
|
||||||
|
*/
|
||||||
|
public function testCustomerCustomerBackupsAddPathNotDocroot()
|
||||||
|
{
|
||||||
|
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' => '/'
|
||||||
|
];
|
||||||
|
|
||||||
|
$this->expectExceptionCode(400);
|
||||||
|
$this->expectExceptionMessage('The folder for backups cannot be your homedir, please chose a folder within your homedir, e.g. /backups');
|
||||||
|
$json_result = CustomerBackups::getLocal($customer_userdata, $data)->add();
|
||||||
|
}
|
||||||
|
|
||||||
public function testAdminCustomerBackupsGet()
|
public function testAdminCustomerBackupsGet()
|
||||||
{
|
{
|
||||||
global $admin_userdata;
|
global $admin_userdata;
|
||||||
|
|||||||
Reference in New Issue
Block a user