@@ -7,22 +7,22 @@ class ServerTest extends TestCase
77 public function testGetProtos ()
88 {
99 $ protos = static ::$ _client ->server ()->getProtos ();
10- $ this ->assertInternalType ( ' array ' , $ protos );
10+ $ this ->assertIsArray ( $ protos );
1111 $ this ->assertContains ('1.6.3.0 ' , $ protos );
1212 }
1313
1414 public function testGetGenInfo ()
1515 {
1616 $ generalInfo = static ::$ _client ->server ()->getGeneralInfo ();
1717 $ 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 ) );
1919 $ this ->assertEquals ('standard ' , $ generalInfo ->mode );
2020 }
2121
2222 public function testGetPreferences ()
2323 {
2424 $ preferences = static ::$ _client ->server ()->getPreferences ();
25- $ this ->assertInternalType ( ' integer ' , $ preferences ->statTtl );
25+ $ this ->assertIsNumeric ( $ preferences ->statTtl );
2626 $ this ->assertGreaterThan (0 , $ preferences ->statTtl );
2727 $ this ->assertEquals (0 , $ preferences ->restartApacheInterval );
2828 }
@@ -37,7 +37,7 @@ public function testGetAdmin()
3737 public function testGetKeyInfo ()
3838 {
3939 $ keyInfo = static ::$ _client ->server ()->getKeyInfo ();
40- $ this ->assertInternalType ( ' array ' , $ keyInfo );
40+ $ this ->assertIsArray ( $ keyInfo );
4141 $ this ->assertGreaterThan (0 , count ($ keyInfo ));
4242 $ this ->assertArrayHasKey ('plesk_key_id ' , $ keyInfo );
4343 $ this ->assertArrayHasKey ('lim_date ' , $ keyInfo );
@@ -46,70 +46,65 @@ public function testGetKeyInfo()
4646 public function testGetComponents ()
4747 {
4848 $ components = static ::$ _client ->server ()->getComponents ();
49- $ this ->assertInternalType ( ' array ' , $ components );
49+ $ this ->assertIsArray ( $ components );
5050 $ this ->assertGreaterThan (0 , count ($ components ));
5151 $ this ->assertArrayHasKey ('psa ' , $ components );
52- $ this ->assertArrayHasKey ('php ' , $ components );
5352 }
5453
5554 public function testGetServiceStates ()
5655 {
5756 $ serviceStates = static ::$ _client ->server ()->getServiceStates ();
58- $ this ->assertInternalType ('array ' , $ serviceStates );
57+
58+ $ this ->assertIsArray ($ serviceStates );
5959 $ 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 );
6866 }
6967
7068 public function testGetSessionPreferences ()
7169 {
7270 $ preferences = static ::$ _client ->server ()->getSessionPreferences ();
73- $ this ->assertInternalType ( ' integer ' , $ preferences ->loginTimeout );
71+ $ this ->assertIsNumeric ( $ preferences ->loginTimeout );
7472 $ this ->assertGreaterThan (0 , $ preferences ->loginTimeout );
7573 }
7674
7775 public function testGetShells ()
7876 {
7977 $ shells = static ::$ _client ->server ()->getShells ();
80- $ this ->assertInternalType ('array ' , $ shells );
81- $ this ->assertGreaterThan (0 , count ($ shells ));
82- $ this ->assertArrayHasKey ('/bin/bash ' , $ shells );
8378
84- $ bash = $ shells[ ' /bin/bash ' ] ;
85- $ this ->assertEquals ( ' /bin/bash ' , $ bash );
79+ $ this -> assertIsArray ( $ shells) ;
80+ $ this ->assertGreaterThan ( 0 , count ( $ shells ) );
8681 }
8782
8883 public function testGetNetworkInterfaces ()
8984 {
9085 $ netInterfaces = static ::$ _client ->server ()->getNetworkInterfaces ();
91- $ this ->assertInternalType ( ' array ' , $ netInterfaces );
86+ $ this ->assertIsArray ( $ netInterfaces );
9287 $ this ->assertGreaterThan (0 , count ($ netInterfaces ));
9388 }
9489
9590 public function testGetStatistics ()
9691 {
9792 $ stats = static ::$ _client ->server ()->getStatistics ();
98- $ this ->assertInternalType ( ' integer ' , $ stats ->objects ->clients );
93+ $ this ->assertIsNumeric ( $ stats ->objects ->clients );
9994 $ this ->assertEquals ('psa ' , $ stats ->version ->internalName );
10095 }
10196
10297 public function testGetSiteIsolationConfig ()
10398 {
10499 $ config = static ::$ _client ->server ()->getSiteIsolationConfig ();
105- $ this ->assertInternalType ( ' array ' , $ config );
100+ $ this ->assertIsArray ( $ config );
106101 $ this ->assertGreaterThan (0 , count ($ config ));
107102 $ this ->assertArrayHasKey ('php ' , $ config );
108103 }
109104
110105 public function testGetUpdatesInfo ()
111106 {
112107 $ updatesInfo = static ::$ _client ->server ()->getUpdatesInfo ();
113- $ this ->assertInternalType ( ' boolean ' , $ updatesInfo ->installUpdatesAutomatically );
108+ $ this ->assertIsBool ( $ updatesInfo ->installUpdatesAutomatically );
114109 }
115110}
0 commit comments