introduce search, limit, offset and orderby possibilities for (almost) all API listing() functions; added listingCount() function in preparation to replace the old UI\Paging class later on

Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
This commit is contained in:
Michael Kaufmann
2019-11-02 10:58:52 +01:00
parent b162324ff0
commit 1b2c186c07
41 changed files with 1149 additions and 130 deletions

View File

@@ -141,6 +141,10 @@ class FpmDaemonsTest extends TestCase
$this->assertEquals(2, $result['count']);
$this->assertEquals('System default', $result['list'][0]['description']);
$this->assertEquals('test2 fpm edit', $result['list'][1]['description']);
$json_result = FpmDaemons::getLocal($admin_userdata)->listingCount();
$result = json_decode($json_result, true)['data'];
$this->assertEquals(2, $result);
}
public function testAdminFpmDaemonsGetNotFound()
@@ -190,6 +194,10 @@ class FpmDaemonsTest extends TestCase
$this->expectExceptionCode(403);
$this->expectExceptionMessage("Not allowed to execute given command.");
FpmDaemons::getLocal($customer_userdata)->listing();
$this->expectExceptionCode(403);
$this->expectExceptionMessage("Not allowed to execute given command.");
FpmDaemons::getLocal($customer_userdata)->listingCount();
}
public function testCustomerFpmDaemonsUpdate()

View File

@@ -23,6 +23,10 @@ class PhpSettingsText extends TestCase
$result = json_decode($json_result, true)['data'];
$this->assertEquals("Default Config", $result['list'][0]['description']);
$this->assertEquals("/usr/bin/php-cgi", $result['list'][0]['binary']);
$json_result = PhpSettings::getLocal($admin_userdata)->listingCount();
$result = json_decode($json_result, true)['data'];
$this->assertEquals(2, $result);
}
public function testCustomerPhpSettingsListNotAllowed()
@@ -36,6 +40,10 @@ class PhpSettingsText extends TestCase
$this->expectExceptionCode(403);
$this->expectExceptionMessage("Not allowed to execute given command.");
PhpSettings::getLocal($customer_userdata)->listing();
$this->expectExceptionCode(403);
$this->expectExceptionMessage("Not allowed to execute given command.");
PhpSettings::getLocal($customer_userdata)->listingCount();
}
public function testAdminPhpSettingsAdd()