@@ -10,9 +10,9 @@ class ApiClientTest extends TestCase
1010 */
1111 public function testWrongProtocol ()
1212 {
13- $ packet = $ this -> _client ->getPacket ('100.0.0 ' );
13+ $ packet = static :: $ _client ->getPacket ('100.0.0 ' );
1414 $ packet ->addChild ('server ' )->addChild ('get_protos ' );
15- $ this -> _client ->request ($ packet );
15+ static :: $ _client ->request ($ packet );
1616 }
1717
1818 /**
@@ -21,9 +21,9 @@ public function testWrongProtocol()
2121 */
2222 public function testUnknownOperator ()
2323 {
24- $ packet = $ this -> _client ->getPacket ();
24+ $ packet = static :: $ _client ->getPacket ();
2525 $ packet ->addChild ('unknown ' );
26- $ this -> _client ->request ($ packet );
26+ static :: $ _client ->request ($ packet );
2727 }
2828
2929 /**
@@ -32,7 +32,7 @@ public function testUnknownOperator()
3232 */
3333 public function testInvalidXmlRequest ()
3434 {
35- $ this -> _client ->request ('<packet><wrongly formatted xml</packet> ' );
35+ static :: $ _client ->request ('<packet><wrongly formatted xml</packet> ' );
3636 }
3737
3838 /**
@@ -41,12 +41,12 @@ public function testInvalidXmlRequest()
4141 */
4242 public function testInvalidCredentials ()
4343 {
44- $ host = $ this -> _client ->getHost ();
45- $ port = $ this -> _client ->getPort ();
46- $ protocol = $ this -> _client ->getProtocol ();
44+ $ host = static :: $ _client ->getHost ();
45+ $ port = static :: $ _client ->getPort ();
46+ $ protocol = static :: $ _client ->getProtocol ();
4747 $ client = new PleskX \Api \Client ($ host , $ port , $ protocol );
4848 $ client ->setCredentials ('bad-login ' , 'bad-password ' );
49- $ packet = $ this -> _client ->getPacket ();
49+ $ packet = static :: $ _client ->getPacket ();
5050 $ packet ->addChild ('server ' )->addChild ('get_protos ' );
5151 $ client ->request ($ packet );
5252 }
@@ -57,46 +57,46 @@ public function testInvalidCredentials()
5757 */
5858 public function testInvalidSecretKey ()
5959 {
60- $ host = $ this -> _client ->getHost ();
61- $ port = $ this -> _client ->getPort ();
62- $ protocol = $ this -> _client ->getProtocol ();
60+ $ host = static :: $ _client ->getHost ();
61+ $ port = static :: $ _client ->getPort ();
62+ $ protocol = static :: $ _client ->getProtocol ();
6363 $ client = new PleskX \Api \Client ($ host , $ port , $ protocol );
6464 $ client ->setSecretKey ('bad-key ' );
65- $ packet = $ this -> _client ->getPacket ();
65+ $ packet = static :: $ _client ->getPacket ();
6666 $ packet ->addChild ('server ' )->addChild ('get_protos ' );
6767 $ client ->request ($ packet );
6868 }
6969
7070 public function testLatestMajorProtocol ()
7171 {
72- $ packet = $ this -> _client ->getPacket ('1.6 ' );
72+ $ packet = static :: $ _client ->getPacket ('1.6 ' );
7373 $ packet ->addChild ('server ' )->addChild ('get_protos ' );
74- $ this -> _client ->request ($ packet );
74+ static :: $ _client ->request ($ packet );
7575 }
7676
7777 public function testLatestMinorProtocol ()
7878 {
79- $ packet = $ this -> _client ->getPacket ('1.6.5 ' );
79+ $ packet = static :: $ _client ->getPacket ('1.6.5 ' );
8080 $ packet ->addChild ('server ' )->addChild ('get_protos ' );
81- $ this -> _client ->request ($ packet );
81+ static :: $ _client ->request ($ packet );
8282 }
8383
8484 public function testRequestShortSyntax ()
8585 {
86- $ response = $ this -> _client ->request ('server.get.gen_info ' );
86+ $ response = static :: $ _client ->request ('server.get.gen_info ' );
8787 $ this ->assertGreaterThan (0 , strlen ($ response ->gen_info ->server_name ));
8888 }
8989
9090 public function testOperatorPlainRequest ()
9191 {
92- $ response = $ this -> _client ->server ()->request ('get.gen_info ' );
92+ $ response = static :: $ _client ->server ()->request ('get.gen_info ' );
9393 $ this ->assertGreaterThan (0 , strlen ($ response ->gen_info ->server_name ));
9494 $ this ->assertEquals (36 , strlen ($ response ->getValue ('server_guid ' )));
9595 }
9696
9797 public function testRequestArraySyntax ()
9898 {
99- $ response = $ this -> _client ->request ([
99+ $ response = static :: $ _client ->request ([
100100 'server ' => [
101101 'get ' => [
102102 'gen_info ' => '' ,
@@ -108,13 +108,13 @@ public function testRequestArraySyntax()
108108
109109 public function testOperatorArraySyntax ()
110110 {
111- $ response = $ this -> _client ->server ()->request (['get ' => ['gen_info ' => '' ]]);
111+ $ response = static :: $ _client ->server ()->request (['get ' => ['gen_info ' => '' ]]);
112112 $ this ->assertGreaterThan (0 , strlen ($ response ->gen_info ->server_name ));
113113 }
114114
115115 public function testMultiRequest ()
116116 {
117- $ responses = $ this -> _client ->multiRequest ([
117+ $ responses = static :: $ _client ->multiRequest ([
118118 'server.get_protos ' ,
119119 'server.get.gen_info ' ,
120120 ]);
0 commit comments