3
3
4
4
namespace PleskXTest ;
5
5
6
+ use PHPUnit \Framework \TestCase ;
7
+ use PleskX \Api \Client ;
6
8
use PleskXTest \Utility \PasswordProvider ;
7
9
8
- abstract class AbstractTestCase extends \ PHPUnit \ Framework \ TestCase
10
+ abstract class AbstractTestCase extends TestCase
9
11
{
10
- /** @var \PleskX\Api\Client */
11
- protected static $ client ;
12
+ protected static Client $ client ;
12
13
13
- private static $ webspaces = [];
14
- private static $ servicePlans = [];
14
+ private static array $ webspaces = [];
15
+ private static array $ servicePlans = [];
15
16
16
17
public static function setUpBeforeClass (): void
17
18
{
@@ -27,7 +28,7 @@ public static function setUpBeforeClass(): void
27
28
list ($ host , $ port , $ scheme ) = [$ parsedUrl ['host ' ], $ parsedUrl ['port ' ], $ parsedUrl ['scheme ' ]];
28
29
}
29
30
30
- static ::$ client = new \ PleskX \ Api \ Client ($ host , $ port , $ scheme );
31
+ static ::$ client = new Client ($ host , $ port , $ scheme );
31
32
static ::$ client ->setCredentials ($ login , $ password );
32
33
33
34
$ proxy = getenv ('REMOTE_PROXY ' );
@@ -55,21 +56,15 @@ public static function tearDownAfterClass(): void
55
56
}
56
57
}
57
58
58
- /**
59
- * @return string
60
- */
61
- protected static function getIpAddress ()
59
+ protected static function getIpAddress (): string
62
60
{
63
61
$ ips = static ::$ client ->ip ()->get ();
64
62
$ ipInfo = reset ($ ips );
65
63
66
64
return $ ipInfo ->ipAddress ;
67
65
}
68
66
69
- /**
70
- * @return \PleskX\Api\Struct\Webspace\Info
71
- */
72
- protected static function createWebspace ()
67
+ protected static function createWebspace (): \PleskX \Api \Struct \Webspace \Info
73
68
{
74
69
$ id = uniqid ();
75
70
$ webspace = static ::$ client ->webspace ()->create (
@@ -87,7 +82,7 @@ protected static function createWebspace()
87
82
return $ webspace ;
88
83
}
89
84
90
- protected static function createServicePlan ()
85
+ protected static function createServicePlan (): \ PleskX \ Api \ Struct \ ServicePlan \ Info
91
86
{
92
87
$ id = uniqid ();
93
88
$ servicePlan = static ::$ client ->servicePlan ()->create (['name ' => "test {$ id }plan " ]);
0 commit comments