Skip to content

Commit 6aa3fcc

Browse files
committed
Reduce duplication of helper method.
1 parent f4896a3 commit 6aa3fcc

File tree

4 files changed

+15
-45
lines changed

4 files changed

+15
-45
lines changed

tests/MailTest.php

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,6 @@
44
class MailTest extends TestCase
55
{
66

7-
/**
8-
* @param string $name
9-
* @return \PleskX\Api\Struct\Webspace\Info
10-
*/
11-
private function _createWebspace($name)
12-
{
13-
return $this->_client->webspace()->create([
14-
'name' => $name,
15-
'ip_address' => $this->_getIpAddress(),
16-
], [
17-
'ftp_login' => 'test-login',
18-
'ftp_password' => 'test-password',
19-
]);
20-
}
21-
227
public function testCreate()
238
{
249
$webspace = $this->_createWebspace('example.dom');

tests/SiteTest.php

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,6 @@
44
class SiteTest extends TestCase
55
{
66

7-
/**
8-
* @param string $name
9-
* @return \PleskX\Api\Struct\Webspace\Info
10-
*/
11-
private function _createWebspace($name)
12-
{
13-
return $this->_client->webspace()->create([
14-
'name' => $name,
15-
'ip_address' => $this->_getIpAddress(),
16-
], [
17-
'ftp_login' => 'test-login',
18-
'ftp_password' => 'test-password',
19-
]);
20-
}
21-
227
private function _createSite($name, $webspace)
238
{
249
return $this->_client->site()->create([

tests/SubdomainTest.php

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,6 @@
44
class SubdomainTest extends TestCase
55
{
66

7-
/**
8-
* @param string $name
9-
* @return \PleskX\Api\Struct\Webspace\Info
10-
*/
11-
private function _createWebspace($name)
12-
{
13-
return $this->_client->webspace()->create([
14-
'name' => $name,
15-
'ip_address' => $this->_getIpAddress(),
16-
], [
17-
'ftp_login' => 'test-login',
18-
'ftp_password' => 'test-password',
19-
]);
20-
}
21-
227
/**
238
* @param string $name
249
* @param string $webspaceName

tests/TestCase.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,19 @@ protected function _getIpAddress()
3434
return $ipInfo->ipAddress;
3535
}
3636

37+
/**
38+
* @param string $name
39+
* @return \PleskX\Api\Struct\Webspace\Info
40+
*/
41+
protected function _createWebspace($name)
42+
{
43+
return $this->_client->webspace()->create([
44+
'name' => $name,
45+
'ip_address' => $this->_getIpAddress(),
46+
], [
47+
'ftp_login' => 'test-login',
48+
'ftp_password' => 'test-password',
49+
]);
50+
}
51+
3752
}

0 commit comments

Comments
 (0)