66
77use Exception ;
88use HttpSoft \Message \Uri ;
9+ use PHPUnit \Framework \Attributes \DataProvider ;
910use PHPUnit \Framework \TestCase ;
1011use Psr \Http \Message \ServerRequestInterface ;
1112use ReflectionClass ;
@@ -171,7 +172,7 @@ public function testGetThrowableName(): void
171172 $ this ->assertSame ('Error ( ' . ErrorException::class . ') ' , $ name );
172173 }
173174
174- public function createServerInformationLinkDataProvider (): array
175+ public static function createServerInformationLinkDataProvider (): array
175176 {
176177 return [
177178 'not-exist ' => [null , '' ],
@@ -185,9 +186,7 @@ public function createServerInformationLinkDataProvider(): array
185186 ];
186187 }
187188
188- /**
189- * @dataProvider createServerInformationLinkDataProvider
190- */
189+ #[DataProvider('createServerInformationLinkDataProvider ' )]
191190 public function testCreateServerInformationLink (?string $ serverSoftware , string $ expected ): void
192191 {
193192 $ renderer = new HtmlRenderer ();
@@ -199,7 +198,7 @@ public function testCreateServerInformationLink(?string $serverSoftware, string
199198 $ this ->assertStringContainsString ($ expected , $ renderer ->createServerInformationLink ($ serverRequestMock ));
200199 }
201200
202- public function argumentsToStringValueDataProvider (): array
201+ public static function argumentsToStringValueDataProvider (): array
203202 {
204203 return [
205204 'int ' => [[1 ], '1 ' ],
@@ -222,11 +221,7 @@ public function argumentsToStringValueDataProvider(): array
222221 ];
223222 }
224223
225- /**
226- * @dataProvider argumentsToStringValueDataProvider
227- *
228- * @param mixed $args
229- */
224+ #[DataProvider('argumentsToStringValueDataProvider ' )]
230225 public function testArgumentsToString (array $ args , string $ expected ): void
231226 {
232227 $ renderer = new HtmlRenderer ();
@@ -270,7 +265,7 @@ public function testGroupVendorCallStackItems(): void
270265 ]));
271266 }
272267
273- public function isVendorFileReturnFalseDataProvider (): array
268+ public static function isVendorFileReturnFalseDataProvider (): array
274269 {
275270 return [
276271 'null ' => [null ],
@@ -279,9 +274,7 @@ public function isVendorFileReturnFalseDataProvider(): array
279274 ];
280275 }
281276
282- /**
283- * @dataProvider isVendorFileReturnFalseDataProvider
284- */
277+ #[DataProvider('isVendorFileReturnFalseDataProvider ' )]
285278 public function testIsVendorFileReturnFalse (?string $ file ): void
286279 {
287280 $ this ->assertFalse ($ this ->invokeMethod (new HtmlRenderer (), 'isVendorFile ' , ['file ' => $ file ]));
0 commit comments