99use EbookReader \Driver \Fb2Driver ;
1010use EbookReader \Exception \ParserException ;
1111use EbookReader \Resource \Style ;
12+ use PHPUnit \Framework \Attributes \DataProvider ;
1213use PHPUnit \Framework \TestCase ;
1314
1415class Fb2DriverTest extends TestCase
1516{
16- /**
17- * @dataProvider filesProvider
18- */
17+ #[DataProvider('filesProvider ' )]
1918 public function testIsValid (string $ file ): void
2019 {
2120 $ driver = new Fb2Driver ($ file );
2221 $ result = $ driver ->isValid ();
2322 self ::assertTrue ($ result );
2423 }
2524
26- /**
27- * @dataProvider filesProviderFake
28- */
25+ #[DataProvider('filesProviderFake ' )]
2926 public function testIsValidFake (string $ file ): void
3027 {
3128 $ driver = new Fb2Driver ($ file );
3229 $ result = $ driver ->isValid ();
3330 self ::assertFalse ($ result );
3431 }
3532
36- /**
37- * @dataProvider filesProvider
38- */
33+ #[DataProvider('filesProvider ' )]
3934 public function testGetMeta (
4035 string $ file ,
4136 string $ expectedTitle ,
@@ -63,9 +58,7 @@ public function testGetMeta(
6358 self ::assertSame ($ expectedPublishDay , $ meta ->getPublishDay ());
6459 }
6560
66- /**
67- * @dataProvider filesProviderFake
68- */
61+ #[DataProvider('filesProviderFake ' )]
6962 public function testGetMetaFake (string $ file ): void
7063 {
7164 $ driver = new Fb2Driver ($ file );
@@ -76,7 +69,7 @@ public function testGetMetaFake(string $file): void
7669 /**
7770 * @return string[][]
7871 */
79- public function filesProviderFake (): array
72+ public static function filesProviderFake (): array
8073 {
8174 return [
8275 [__DIR__ .'/../fixtures/fake.xml ' ],
@@ -87,9 +80,8 @@ public function filesProviderFake(): array
8780 /**
8881 * @param Style[] $expectedStyles
8982 * @param Fb2DataEpigraph[] $expectedEpigraphs
90- *
91- * @dataProvider filesDataProvider
9283 */
84+ #[DataProvider('filesDataProvider ' )]
9385 public function testGetData (
9486 string $ file ,
9587 int $ expectedCount ,
@@ -130,7 +122,7 @@ public function testGetData(
130122 }
131123 }
132124
133- public function filesDataProvider (): array
125+ public static function filesDataProvider (): array
134126 {
135127 return [
136128 [__DIR__ .'/../fixtures/fb2/fb2.fb2 ' ,
@@ -171,7 +163,7 @@ public function filesDataProvider(): array
171163 ];
172164 }
173165
174- public function filesProvider (): array
166+ public static function filesProvider (): array
175167 {
176168 return [
177169 [__DIR__ .'/../fixtures/fb2/fb2.fb2 ' ,
0 commit comments