Skip to content

Commit a3db848

Browse files
committed
Add an ability to delete a subdomain.
1 parent af7a4a4 commit a3db848

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

src/PleskX/Api/Operator/Subdomain.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,14 @@ public function create($properties)
2222
$response = $this->_client->request($packet);
2323
return new Struct\Info($response);
2424
}
25+
26+
/**
27+
* @param string $field
28+
* @param integer|string $value
29+
* @return bool
30+
*/
31+
public function delete($field, $value)
32+
{
33+
return $this->_delete($field, $value);
34+
}
2535
}

tests/SubdomainTest.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,4 +43,15 @@ public function testCreate()
4343

4444
$this->_client->webspace()->delete('id', $webspace->id);
4545
}
46+
47+
public function testDelete()
48+
{
49+
$webspaceName = 'example.tld';
50+
$webspace = $this->_createWebspace($webspaceName);
51+
$subdomain = $this->_createSubdomain('sub', $webspaceName);
52+
53+
$result = $this->_client->subdomain()->delete('id', $subdomain->id);
54+
$this->assertTrue($result);
55+
$this->_client->webspace()->delete('id', $webspace->id);
56+
}
4657
}

0 commit comments

Comments
 (0)