Skip to content

Commit 30f5ea8

Browse files
author
Alexandr Bashurov
committed
Replace license checks with KeyLimitChecker invokation
1 parent d8bcfad commit 30f5ea8

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

tests/CustomerTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// Copyright 1999-2019. Plesk International GmbH.
33
namespace PleskXTest;
44

5+
use PleskXTest\Utility\KeyLimitChecker;
56
use PleskXTest\Utility\PasswordProvider;
67

78
class CustomerTest extends TestCase
@@ -55,7 +56,7 @@ public function testGetAll()
5556
{
5657
$keyInfo = static::$_client->server()->getKeyInfo();
5758

58-
if ((int)$keyInfo['lim_cl'] < 2) {
59+
if (!KeyLimitChecker::checkByType($keyInfo, KeyLimitChecker::LIMIT_CLIENTS, 2)) {
5960
$this->markTestSkipped('License does not allow to create more than 1 customer.');
6061
}
6162

tests/ResellerTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// Copyright 1999-2019. Plesk International GmbH.
33
namespace PleskXTest;
44

5+
use PleskXTest\Utility\KeyLimitChecker;
56
use PleskXTest\Utility\PasswordProvider;
67

78
class ResellerTest extends TestCase
@@ -48,7 +49,7 @@ public function testGetAll()
4849
{
4950
$keyInfo = static::$_client->server()->getKeyInfo();
5051

51-
if ((int)$keyInfo['lim_cl'] < 2) {
52+
if (!KeyLimitChecker::checkByType($keyInfo, KeyLimitChecker::LIMIT_RESELLERS, 2)) {
5253
$this->markTestSkipped('License does not allow to create more than 1 reseller.');
5354
}
5455

tests/SiteTest.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
// Copyright 1999-2019. Plesk International GmbH.
33
namespace PleskXTest;
44

5+
use PleskXTest\Utility\KeyLimitChecker;
6+
57
class SiteTest extends TestCase
68
{
79
/** @var \PleskX\Api\Struct\Webspace\Info */
@@ -19,7 +21,7 @@ protected function setUp()
1921

2022
$keyInfo = static::$_client->server()->getKeyInfo();
2123

22-
if ((int)$keyInfo['lim_dom'] < 2) {
24+
if (!KeyLimitChecker::checkByType($keyInfo, KeyLimitChecker::LIMIT_DOMAINS, 2)) {
2325
$this->markTestSkipped('License does not allow to create more than 1 domain.');
2426
}
2527
}

0 commit comments

Comments
 (0)