11<?php
22declare (strict_types=1 );
33
4+ use PHPUnit \Framework \Attributes \DataProvider ;
45 use xPaw \SourceQuery \BaseSocket ;
56 use xPaw \SourceQuery \SourceQuery ;
67 use xPaw \SourceQuery \Buffer ;
@@ -110,9 +111,6 @@ public function testNotConnectedGetPlayers() : void
110111 $ this ->SourceQuery ->GetPlayers ();
111112 }
112113
113- /**
114- * @expectedException xPaw\SourceQuery\Exception\SocketException
115- */
116114 public function testNotConnectedGetRules () : void
117115 {
118116 $ this ->expectException ( xPaw \SourceQuery \Exception \SocketException::class );
@@ -140,9 +138,7 @@ public function testRconWithoutPassword() : void
140138 $ this ->SourceQuery ->Rcon ('a ' );
141139 }
142140
143- /**
144- * @dataProvider InfoProvider
145- */
141+ #[DataProvider( 'InfoProvider ' )]
146142 public function testGetInfo ( string $ RawInput , array $ ExpectedOutput ) : void
147143 {
148144 if ( isset ( $ ExpectedOutput [ 'IsMod ' ] ) )
@@ -180,9 +176,7 @@ public static function InfoProvider() : array
180176 return $ DataProvider ;
181177 }
182178
183- /**
184- * @dataProvider BadPacketProvider
185- */
179+ #[DataProvider( 'BadPacketProvider ' )]
186180 public function testBadGetInfo ( string $ Data ) : void
187181 {
188182 $ this ->expectException ( xPaw \SourceQuery \Exception \InvalidPacketException::class );
@@ -191,9 +185,7 @@ public function testBadGetInfo( string $Data ) : void
191185 $ this ->SourceQuery ->GetInfo ();
192186 }
193187
194- /**
195- * @dataProvider BadPacketProvider
196- */
188+ #[DataProvider( 'BadPacketProvider ' )]
197189 public function testBadGetChallengeViaPlayers ( string $ Data ) : void
198190 {
199191 $ this ->expectException ( xPaw \SourceQuery \Exception \InvalidPacketException::class );
@@ -202,9 +194,7 @@ public function testBadGetChallengeViaPlayers( string $Data ) : void
202194 $ this ->SourceQuery ->GetPlayers ();
203195 }
204196
205- /**
206- * @dataProvider BadPacketProvider
207- */
197+ #[DataProvider( 'BadPacketProvider ' )]
208198 public function testBadGetPlayersAfterCorrectChallenge ( string $ Data ) : void
209199 {
210200 $ this ->expectException ( xPaw \SourceQuery \Exception \InvalidPacketException::class );
@@ -214,9 +204,7 @@ public function testBadGetPlayersAfterCorrectChallenge( string $Data ) : void
214204 $ this ->SourceQuery ->GetPlayers ();
215205 }
216206
217- /**
218- * @dataProvider BadPacketProvider
219- */
207+ #[DataProvider( 'BadPacketProvider ' )]
220208 public function testBadGetRulesAfterCorrectChallenge ( string $ Data ) : void
221209 {
222210 $ this ->expectException ( xPaw \SourceQuery \Exception \InvalidPacketException::class );
@@ -250,10 +238,8 @@ public function testGetChallengeTwice( ) : void
250238 self ::assertEquals ( [ 'wow ' => 'much ' ], $ this ->SourceQuery ->GetRules () );
251239 }
252240
253- /**
254- * @dataProvider RulesProvider
255- * @param array<string> $RawInput
256- */
241+ /** @param array<string> $RawInput */
242+ #[DataProvider( 'RulesProvider ' )]
257243 public function testGetRules ( array $ RawInput , array $ ExpectedOutput ) : void
258244 {
259245 $ this ->Socket ->Queue ( (string )hex2bin ( "ffffffff4104fce20e " ) ); // Challenge
@@ -291,10 +277,8 @@ public static function RulesProvider() : array
291277 return $ DataProvider ;
292278 }
293279
294- /**
295- * @dataProvider PlayersProvider
296- * @param array<string> $RawInput
297- */
280+ /** @param array<string> $RawInput */
281+ #[DataProvider( 'PlayersProvider ' )]
298282 public function testGetPlayers ( array $ RawInput , array $ ExpectedOutput ) : void
299283 {
300284 $ this ->Socket ->Queue ( (string )hex2bin ( "ffffffff4104fce20e " ) ); // Challenge
0 commit comments