@@ -61,7 +61,7 @@ public function Sherlock( Buffer $Buffer, int $Length ) : bool
6161 }
6262 }
6363
64- class SourceQueryTests extends TestCase
64+ class Tests extends \ PHPUnit \ Framework \ TestCase
6565 {
6666 private TestableSocket $ Socket ;
6767 private SourceQuery $ SourceQuery ;
@@ -80,38 +80,30 @@ public function tearDown() : void
8080 unset( $ this ->Socket , $ this ->SourceQuery );
8181 }
8282
83- /**
84- * @expectedException xPaw\SourceQuery\Exception\InvalidArgumentException
85- */
8683 public function testInvalidTimeout () : void
8784 {
85+ $ this ->expectException ( 'xPaw\SourceQuery\Exception\InvalidArgumentException ' );
8886 $ SourceQuery = new SourceQuery ( );
8987 $ SourceQuery ->Connect ( '' , 2 , -1 );
9088 }
9189
92- /**
93- * @expectedException xPaw\SourceQuery\Exception\SocketException
94- */
9590 public function testNotConnectedGetInfo () : void
9691 {
92+ $ this ->expectException ( 'xPaw\SourceQuery\Exception\SocketException ' );
9793 $ this ->SourceQuery ->Disconnect ();
9894 $ this ->SourceQuery ->GetInfo ();
9995 }
10096
101- /**
102- * @expectedException xPaw\SourceQuery\Exception\SocketException
103- */
10497 public function testNotConnectedPing () : void
10598 {
99+ $ this ->expectException ( 'xPaw\SourceQuery\Exception\SocketException ' );
106100 $ this ->SourceQuery ->Disconnect ();
107101 $ this ->SourceQuery ->Ping ();
108102 }
109103
110- /**
111- * @expectedException xPaw\SourceQuery\Exception\SocketException
112- */
113104 public function testNotConnectedGetPlayers () : void
114105 {
106+ $ this ->expectException ( 'xPaw\SourceQuery\Exception\SocketException ' );
115107 $ this ->SourceQuery ->Disconnect ();
116108 $ this ->SourceQuery ->GetPlayers ();
117109 }
@@ -121,33 +113,28 @@ public function testNotConnectedGetPlayers() : void
121113 */
122114 public function testNotConnectedGetRules () : void
123115 {
116+ $ this ->expectException ( 'xPaw\SourceQuery\Exception\SocketException ' );
124117 $ this ->SourceQuery ->Disconnect ();
125118 $ this ->SourceQuery ->GetRules ();
126119 }
127120
128- /**
129- * @expectedException xPaw\SourceQuery\Exception\SocketException
130- */
131121 public function testNotConnectedSetRconPassword () : void
132122 {
123+ $ this ->expectException ( 'xPaw\SourceQuery\Exception\SocketException ' );
133124 $ this ->SourceQuery ->Disconnect ();
134125 $ this ->SourceQuery ->SetRconPassword ('a ' );
135126 }
136127
137- /**
138- * @expectedException xPaw\SourceQuery\Exception\SocketException
139- */
140128 public function testNotConnectedRcon () : void
141129 {
130+ $ this ->expectException ( 'xPaw\SourceQuery\Exception\SocketException ' );
142131 $ this ->SourceQuery ->Disconnect ();
143132 $ this ->SourceQuery ->Rcon ('a ' );
144133 }
145134
146- /**
147- * @expectedException xPaw\SourceQuery\Exception\SocketException
148- */
149135 public function testRconWithoutPassword () : void
150136 {
137+ $ this ->expectException ( 'xPaw\SourceQuery\Exception\SocketException ' );
151138 $ this ->SourceQuery ->Rcon ('a ' );
152139 }
153140
@@ -187,45 +174,45 @@ public function InfoProvider() : array
187174 }
188175
189176 /**
190- * @expectedException xPaw\SourceQuery\Exception\InvalidPacketException
191177 * @dataProvider BadPacketProvider
192178 */
193179 public function testBadGetInfo ( string $ Data ) : void
194180 {
181+ $ this ->expectException ( 'xPaw\SourceQuery\Exception\InvalidPacketException ' );
195182 $ this ->Socket ->Queue ( $ Data );
196183
197184 $ this ->SourceQuery ->GetInfo ();
198185 }
199186
200187 /**
201- * @expectedException xPaw\SourceQuery\Exception\InvalidPacketException
202188 * @dataProvider BadPacketProvider
203189 */
204190 public function testBadGetChallengeViaPlayers ( string $ Data ) : void
205191 {
192+ $ this ->expectException ( 'xPaw\SourceQuery\Exception\InvalidPacketException ' );
206193 $ this ->Socket ->Queue ( $ Data );
207194
208195 $ this ->SourceQuery ->GetPlayers ();
209196 }
210197
211198 /**
212- * @expectedException xPaw\SourceQuery\Exception\InvalidPacketException
213199 * @dataProvider BadPacketProvider
214200 */
215201 public function testBadGetPlayersAfterCorrectChallenge ( string $ Data ) : void
216202 {
203+ $ this ->expectException ( 'xPaw\SourceQuery\Exception\InvalidPacketException ' );
217204 $ this ->Socket ->Queue ( "\xFF\xFF\xFF\xFF\x41\x11\x11\x11\x11" );
218205 $ this ->Socket ->Queue ( $ Data );
219206
220207 $ this ->SourceQuery ->GetPlayers ();
221208 }
222209
223210 /**
224- * @expectedException xPaw\SourceQuery\Exception\InvalidPacketException
225211 * @dataProvider BadPacketProvider
226212 */
227213 public function testBadGetRulesAfterCorrectChallenge ( string $ Data ) : void
228214 {
215+ $ this ->expectException ( 'xPaw\SourceQuery\Exception\InvalidPacketException ' );
229216 $ this ->Socket ->Queue ( "\xFF\xFF\xFF\xFF\x41\x11\x11\x11\x11" );
230217 $ this ->Socket ->Queue ( $ Data );
231218
0 commit comments