66use Antistatique \Pricehubble \Resource \AbstractResource ;
77use Antistatique \Pricehubble \Tests \Traits \TestPrivateTrait ;
88use phpmock \phpunit \PHPMock ;
9+ use PHPUnit \Framework \Attributes \DataProvider ;
10+ use PHPUnit \Framework \Attributes \Group ;
911use PHPUnit \Framework \TestCase ;
1012
1113/**
1214 * @coversDefaultClass \Antistatique\Pricehubble\Pricehubble
1315 *
14- * @group pricehubble
15- * @group pricehubble_unit
16- *
1716 * @internal
1817 */
18+ #[Group('pricehubble ' )]
19+ #[Group('pricehubble_unit ' )]
1920final class PricehubbleTest extends TestCase
2021{
2122 use TestPrivateTrait;
@@ -125,7 +126,7 @@ public function testAuthenticateOnSuccessSetApiToken(): void
125126 $ mock = $ this ->getMockBuilder (Pricehubble::class)
126127 ->disableOriginalConstructor ()
127128 ->onlyMethods (['makeRequest ' , 'setApiToken ' ])
128- ->getMockForAbstractClass ();
129+ ->getMock ();
129130
130131 $ mock ->expects (self ::once ())
131132 ->method ('makeRequest ' )
@@ -149,7 +150,7 @@ public function testAuthenticateOnError(): void
149150 $ mock = $ this ->getMockBuilder (Pricehubble::class)
150151 ->disableOriginalConstructor ()
151152 ->onlyMethods (['makeRequest ' , 'setApiToken ' ])
152- ->getMockForAbstractClass ();
153+ ->getMock ();
153154
154155 $ mock ->expects (self ::once ())
155156 ->method ('makeRequest ' )
@@ -243,9 +244,8 @@ public function testGetHeadersAsArray()
243244
244245 /**
245246 * @covers ::findHttpStatus
246- *
247- * @dataProvider providerHttpStatus
248247 */
248+ #[DataProvider('providerHttpStatus ' )]
249249 public function testFindHttpStatus ($ response , $ formatted_response , $ expected_code )
250250 {
251251 $ code = $ this ->callPrivateMethod ($ this ->pricehubble , 'findHttpStatus ' , [
@@ -261,7 +261,7 @@ public function testFindHttpStatus($response, $formatted_response, $expected_cod
261261 * @return array
262262 * Variation of HTTP Status response
263263 */
264- public function providerHttpStatus ()
264+ public static function providerHttpStatus ()
265265 {
266266 return [
267267 [
@@ -309,9 +309,8 @@ public function providerHttpStatus()
309309
310310 /**
311311 * @covers ::determineSuccess
312- *
313- * @dataProvider providerStatus200
314312 */
313+ #[DataProvider('providerStatus200 ' )]
315314 public function testDetermineSuccessStatus200 ($ code )
316315 {
317316 $ pricehubble_mock = $ this ->getMockBuilder (Pricehubble::class)
@@ -336,7 +335,7 @@ public function testDetermineSuccessStatus200($code)
336335 * @return array
337336 * Variation of HTTP Status response
338337 */
339- public function providerStatus200 ()
338+ public static function providerStatus200 ()
340339 {
341340 return [
342341 [
@@ -608,9 +607,8 @@ public function testMakeRequestGet(): void
608607
609608 /**
610609 * @covers ::makeRequest
611- *
612- * @dataProvider providerHttpVerbs
613610 */
611+ #[DataProvider('providerHttpVerbs ' )]
614612 public function testMakeRequestByVerbs (string $ verb ): void
615613 {
616614 $ pricehubble_mock = $ this ->getMockBuilder (Pricehubble::class)
@@ -693,7 +691,7 @@ public function testMakeRequestArgsLanguage(): void
693691 *
694692 * @return iterable Variation of HTTP Verbs
695693 */
696- public function providerHttpVerbs (): iterable
694+ public static function providerHttpVerbs (): iterable
697695 {
698696 yield ['post ' ];
699697 yield ['delete ' ];
0 commit comments