Skip to content

Commit 9f7fb5e

Browse files
committed
Make tests to work with evaluation license
1 parent d4e3a98 commit 9f7fb5e

File tree

4 files changed

+31
-0
lines changed

4 files changed

+31
-0
lines changed

tests/CustomerTest.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,12 @@ public function testGet()
4646

4747
public function testGetAll()
4848
{
49+
$keyInfo = static::$_client->server()->getKeyInfo();
50+
51+
if ((int)$keyInfo['lim_cl'] < 2) {
52+
$this->markTestSkipped('License does not allow to create more than 1 customer.');
53+
}
54+
4955
static::$_client->customer()->create([
5056
'pname' => 'John Smith',
5157
'login' => 'customer-a',

tests/ResellerTest.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,12 @@ public function testGet()
3939

4040
public function testGetAll()
4141
{
42+
$keyInfo = static::$_client->server()->getKeyInfo();
43+
44+
if ((int)$keyInfo['lim_cl'] < 2) {
45+
$this->markTestSkipped('License does not allow to create more than 1 reseller.');
46+
}
47+
4248
static::$_client->reseller()->create([
4349
'pname' => 'John Reseller',
4450
'login' => 'reseller-a',

tests/SiteTest.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,17 @@ public static function setUpBeforeClass()
1313
static::$webspace = static::_createWebspace();
1414
}
1515

16+
protected function setUp()
17+
{
18+
parent::setUp();
19+
20+
$keyInfo = static::$_client->server()->getKeyInfo();
21+
22+
if ((int)$keyInfo['lim_dom'] < 2) {
23+
$this->markTestSkipped('License does not allow to create more than 1 domain.');
24+
}
25+
}
26+
1627
private function _createSite($name, array $properties = [])
1728
{
1829
$properties = array_merge([

tests/WebspaceTest.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ public function testGetDiskUsage()
2424
$diskusage = static::$_client->webspace()->getDiskUsage('id', $webspace->id);
2525

2626
$this->assertObjectHasAttribute('httpdocs', $diskusage);
27+
28+
static::$_client->webspace()->delete('id', $webspace->id);
2729
}
2830

2931
public function testGetPhysicalHostingDescriptor()
@@ -43,13 +45,17 @@ public function testGetPhpSettings()
4345
$info = static::$_client->webspace()->getPhpSettings('id', $webspace->id);
4446

4547
$this->assertArrayHasKey('open_basedir', $info->properties);
48+
49+
static::$_client->webspace()->delete('id', $webspace->id);
4650
}
4751

4852
public function testCreateWebspace()
4953
{
5054
$webspace = static::_createWebspace();
5155

5256
$this->assertGreaterThan(0, $webspace->id);
57+
58+
static::$_client->webspace()->delete('id', $webspace->id);
5359
}
5460

5561
public function testDelete()
@@ -151,5 +157,7 @@ public function testGet()
151157

152158
$this->assertNotEmpty($webspaceInfo->name);
153159
$this->assertEquals(0, $webspaceInfo->realSize);
160+
161+
static::$_client->webspace()->delete('id', $webspace->id);
154162
}
155163
}

0 commit comments

Comments
 (0)