@@ -7,22 +7,22 @@ class ServerTest extends TestCase
7
7
public function testGetProtos ()
8
8
{
9
9
$ protos = static ::$ _client ->server ()->getProtos ();
10
- $ this ->assertInternalType ( ' array ' , $ protos );
10
+ $ this ->assertIsArray ( $ protos );
11
11
$ this ->assertContains ('1.6.3.0 ' , $ protos );
12
12
}
13
13
14
14
public function testGetGenInfo ()
15
15
{
16
16
$ generalInfo = static ::$ _client ->server ()->getGeneralInfo ();
17
17
$ this ->assertGreaterThan (0 , strlen ($ generalInfo ->serverName ));
18
- $ this ->assertRegExp ('/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/ ' , $ generalInfo ->serverGuid );
18
+ $ this ->assertRegExp ('/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/ ' , strtolower ( $ generalInfo ->serverGuid ) );
19
19
$ this ->assertEquals ('standard ' , $ generalInfo ->mode );
20
20
}
21
21
22
22
public function testGetPreferences ()
23
23
{
24
24
$ preferences = static ::$ _client ->server ()->getPreferences ();
25
- $ this ->assertInternalType ( ' integer ' , $ preferences ->statTtl );
25
+ $ this ->assertIsNumeric ( $ preferences ->statTtl );
26
26
$ this ->assertGreaterThan (0 , $ preferences ->statTtl );
27
27
$ this ->assertEquals (0 , $ preferences ->restartApacheInterval );
28
28
}
@@ -37,7 +37,7 @@ public function testGetAdmin()
37
37
public function testGetKeyInfo ()
38
38
{
39
39
$ keyInfo = static ::$ _client ->server ()->getKeyInfo ();
40
- $ this ->assertInternalType ( ' array ' , $ keyInfo );
40
+ $ this ->assertIsArray ( $ keyInfo );
41
41
$ this ->assertGreaterThan (0 , count ($ keyInfo ));
42
42
$ this ->assertArrayHasKey ('plesk_key_id ' , $ keyInfo );
43
43
$ this ->assertArrayHasKey ('lim_date ' , $ keyInfo );
@@ -46,70 +46,65 @@ public function testGetKeyInfo()
46
46
public function testGetComponents ()
47
47
{
48
48
$ components = static ::$ _client ->server ()->getComponents ();
49
- $ this ->assertInternalType ( ' array ' , $ components );
49
+ $ this ->assertIsArray ( $ components );
50
50
$ this ->assertGreaterThan (0 , count ($ components ));
51
51
$ this ->assertArrayHasKey ('psa ' , $ components );
52
- $ this ->assertArrayHasKey ('php ' , $ components );
53
52
}
54
53
55
54
public function testGetServiceStates ()
56
55
{
57
56
$ serviceStates = static ::$ _client ->server ()->getServiceStates ();
58
- $ this ->assertInternalType ('array ' , $ serviceStates );
57
+
58
+ $ this ->assertIsArray ($ serviceStates );
59
59
$ this ->assertGreaterThan (0 , count ($ serviceStates ));
60
- $ this ->assertArrayHasKey ('web ' , $ serviceStates );
61
-
62
- $ webService = $ serviceStates ['web ' ];
63
- $ this ->assertInternalType ('array ' , $ webService );
64
- $ this ->assertArrayHasKey ('id ' , $ webService );
65
- $ this ->assertArrayHasKey ('title ' , $ webService );
66
- $ this ->assertArrayHasKey ('state ' , $ webService );
67
- $ this ->assertEquals ('running ' , $ webService ['state ' ]);
60
+
61
+ $ service = current ($ serviceStates );
62
+ $ this ->assertIsArray ($ service );
63
+ $ this ->assertArrayHasKey ('id ' , $ service );
64
+ $ this ->assertArrayHasKey ('title ' , $ service );
65
+ $ this ->assertArrayHasKey ('state ' , $ service );
68
66
}
69
67
70
68
public function testGetSessionPreferences ()
71
69
{
72
70
$ preferences = static ::$ _client ->server ()->getSessionPreferences ();
73
- $ this ->assertInternalType ( ' integer ' , $ preferences ->loginTimeout );
71
+ $ this ->assertIsNumeric ( $ preferences ->loginTimeout );
74
72
$ this ->assertGreaterThan (0 , $ preferences ->loginTimeout );
75
73
}
76
74
77
75
public function testGetShells ()
78
76
{
79
77
$ shells = static ::$ _client ->server ()->getShells ();
80
- $ this ->assertInternalType ('array ' , $ shells );
81
- $ this ->assertGreaterThan (0 , count ($ shells ));
82
- $ this ->assertArrayHasKey ('/bin/bash ' , $ shells );
83
78
84
- $ bash = $ shells[ ' /bin/bash ' ] ;
85
- $ this ->assertEquals ( ' /bin/bash ' , $ bash );
79
+ $ this -> assertIsArray ( $ shells) ;
80
+ $ this ->assertGreaterThan ( 0 , count ( $ shells ) );
86
81
}
87
82
88
83
public function testGetNetworkInterfaces ()
89
84
{
90
85
$ netInterfaces = static ::$ _client ->server ()->getNetworkInterfaces ();
91
- $ this ->assertInternalType ( ' array ' , $ netInterfaces );
86
+ $ this ->assertIsArray ( $ netInterfaces );
92
87
$ this ->assertGreaterThan (0 , count ($ netInterfaces ));
93
88
}
94
89
95
90
public function testGetStatistics ()
96
91
{
97
92
$ stats = static ::$ _client ->server ()->getStatistics ();
98
- $ this ->assertInternalType ( ' integer ' , $ stats ->objects ->clients );
93
+ $ this ->assertIsNumeric ( $ stats ->objects ->clients );
99
94
$ this ->assertEquals ('psa ' , $ stats ->version ->internalName );
100
95
}
101
96
102
97
public function testGetSiteIsolationConfig ()
103
98
{
104
99
$ config = static ::$ _client ->server ()->getSiteIsolationConfig ();
105
- $ this ->assertInternalType ( ' array ' , $ config );
100
+ $ this ->assertIsArray ( $ config );
106
101
$ this ->assertGreaterThan (0 , count ($ config ));
107
102
$ this ->assertArrayHasKey ('php ' , $ config );
108
103
}
109
104
110
105
public function testGetUpdatesInfo ()
111
106
{
112
107
$ updatesInfo = static ::$ _client ->server ()->getUpdatesInfo ();
113
- $ this ->assertInternalType ( ' boolean ' , $ updatesInfo ->installUpdatesAutomatically );
108
+ $ this ->assertIsBool ( $ updatesInfo ->installUpdatesAutomatically );
114
109
}
115
110
}
0 commit comments