33
44namespace PleskXTest ;
55
6+ use PHPUnit \Framework \TestCase ;
7+ use PleskX \Api \Client ;
68use PleskXTest \Utility \PasswordProvider ;
79
8- abstract class AbstractTestCase extends \ PHPUnit \ Framework \ TestCase
10+ abstract class AbstractTestCase extends TestCase
911{
10- /** @var \PleskX\Api\Client */
11- protected static $ client ;
12+ protected static Client $ client ;
1213
13- private static $ webspaces = [];
14- private static $ servicePlans = [];
14+ private static array $ webspaces = [];
15+ private static array $ servicePlans = [];
1516
1617 public static function setUpBeforeClass (): void
1718 {
@@ -27,7 +28,7 @@ public static function setUpBeforeClass(): void
2728 list ($ host , $ port , $ scheme ) = [$ parsedUrl ['host ' ], $ parsedUrl ['port ' ], $ parsedUrl ['scheme ' ]];
2829 }
2930
30- static ::$ client = new \ PleskX \ Api \ Client ($ host , $ port , $ scheme );
31+ static ::$ client = new Client ($ host , $ port , $ scheme );
3132 static ::$ client ->setCredentials ($ login , $ password );
3233
3334 $ proxy = getenv ('REMOTE_PROXY ' );
@@ -55,21 +56,15 @@ public static function tearDownAfterClass(): void
5556 }
5657 }
5758
58- /**
59- * @return string
60- */
61- protected static function getIpAddress ()
59+ protected static function getIpAddress (): string
6260 {
6361 $ ips = static ::$ client ->ip ()->get ();
6462 $ ipInfo = reset ($ ips );
6563
6664 return $ ipInfo ->ipAddress ;
6765 }
6866
69- /**
70- * @return \PleskX\Api\Struct\Webspace\Info
71- */
72- protected static function createWebspace ()
67+ protected static function createWebspace (): \PleskX \Api \Struct \Webspace \Info
7368 {
7469 $ id = uniqid ();
7570 $ webspace = static ::$ client ->webspace ()->create (
@@ -87,7 +82,7 @@ protected static function createWebspace()
8782 return $ webspace ;
8883 }
8984
90- protected static function createServicePlan ()
85+ protected static function createServicePlan (): \ PleskX \ Api \ Struct \ ServicePlan \ Info
9186 {
9287 $ id = uniqid ();
9388 $ servicePlan = static ::$ client ->servicePlan ()->create (['name ' => "test {$ id }plan " ]);
0 commit comments