44
55namespace RoaveTest \BackwardCompatibility \Configuration ;
66
7+ use PHPUnit \Framework \Attributes \After ;
8+ use PHPUnit \Framework \Attributes \Before ;
9+ use PHPUnit \Framework \Attributes \CoversClass ;
10+ use PHPUnit \Framework \Attributes \DataProvider ;
711use PHPUnit \Framework \TestCase ;
812use Psl \Env ;
913use Psl \File ;
1418use Roave \BackwardCompatibility \Configuration \InvalidConfigurationStructure ;
1519use Roave \BackwardCompatibility \Configuration \ParseXmlConfigurationFile ;
1620
21+ #[CoversClass(ParseXmlConfigurationFile::class)]
1722final class ParseXmlConfigurationFileTest extends TestCase
1823{
1924 private string $ temporaryDirectory ;
2025
21- /** @before */
26+ #[Before]
2227 public function prepareFilesystem (): void
2328 {
2429 $ this ->temporaryDirectory = Filesystem \create_temporary_file (
@@ -33,25 +38,22 @@ public function prepareFilesystem(): void
3338 Filesystem \create_directory ($ this ->temporaryDirectory );
3439 }
3540
36- /** @after */
41+ #[After]
3742 public function cleanUpFilesystem (): void
3843 {
3944 Shell \execute ('rm ' , ['-rf ' , $ this ->temporaryDirectory ]);
4045 }
4146
42- /** @test */
43- public function defaultConfigurationShouldBeUsedWhenFileDoesNotExist (): void
47+ public function testDefaultConfigurationShouldBeUsedWhenFileDoesNotExist (): void
4448 {
4549 $ config = (new ParseXmlConfigurationFile ())->parse ($ this ->temporaryDirectory );
4650
4751 self ::assertEquals (Configuration::default (), $ config );
4852 }
4953
50- /**
51- * @test
52- * @dataProvider invalidConfiguration
53- */
54- public function exceptionShouldBeRaisedWhenStructureIsInvalid (
54+ /** @dataProvider invalidConfiguration */
55+ #[DataProvider('invalidConfiguration ' )]
56+ public function testExceptionShouldBeRaisedWhenStructureIsInvalid (
5557 string $ xmlContents ,
5658 string $ expectedError ,
5759 ): void {
@@ -122,11 +124,9 @@ public static function invalidConfiguration(): iterable
122124 ];
123125 }
124126
125- /**
126- * @test
127- * @dataProvider validConfiguration
128- */
129- public function baselineShouldBeParsed (
127+ /** @dataProvider validConfiguration */
128+ #[DataProvider('validConfiguration ' )]
129+ public function testBaselineShouldBeParsed (
130130 string $ xmlContents ,
131131 Baseline $ expectedBaseline ,
132132 ): void {
0 commit comments