Repository: symfony/symfony
File: src/Symfony/Component/Yaml/Tests/YamlTestSuiteTest.php (PHP)

Code before:
        'KK5P', 'L94M', 'LE5A', 'LQZ7', 'LX3P', 'M29M', 'M2N8-00', 'M5C3', 'M5DY', 'M9B4', 'MJS9', 'MUS6-00', 'MUS6-02', 'MUS6-03',
        'MUS6-04', 'MUS6-05', 'MUS6-06', 'MYW6', 'N782', 'NKF9', 'P76L', 'P94K', 'PUW8', 'PW8X', 'Q5MG', 'Q9WF', 'QB6E', 'RR7F', 'RXY3',
        'RZP5', 'RZT7', 'S3PD', 'S4T7', 'S98Z', 'S9E8', 'SKE5', 'SR86', 'SU5Z', 'SU74', 'SY6V', 'T26H', 'T833', 'TS54', 'U3C3', 'U3XV',
        'U9NS', 'UKK6-02', 'UT92', 'V9D5', 'W4TN', 'W9L4', 'WZ62', 'X38W', 'X8DW', 'XW4D', 'Y79Y-003', 'Y79Y-004', 'Y79Y-005', 'Y79Y-006',
        'Y79Y-008', 'Y79Y-009', 'YJV2', 'Z9M4', 'ZWK4',
        // Test cases that have different parsing results than using the in.json as expected
        '2G84-02', '2G84-03', '3R3P', '3RLN-02', '3RLN-05', '4Q9F', '4ZYM', '58MP', '5GBF', '5T43', '6FWR', '6JQW', '6PBE', '6WPF', '7A4E',
        '7BMT', '82AN', '8KB6', '96L6', '9MQT-00', '9TFX', 'B3HG', 'CT4Q', 'DE56-01', 'DE56-03', 'DE56-04', 'DE56-05', 'DK3J', 'DK95-02',
        'DK95-08', 'F6MC', 'FP8R', 'HWV9', 'JEF9-00', 'JEF9-01', 'JEF9-02', 'K858', 'KSS4', 'L24T-01', 'L383', 'L9U5', 'M2N8-01', 'M7A3',
        'NAT4', 'NHX8', 'NJ66', 'NP9H', 'P2AD', 'PRH3', 'Q8AD', 'QT73', 'R4YG', 'RTP8', 'SBG9', 'SM9W-01', 'T4YY', 'T5N4', 'TL85', 'UGM3',
        'UKK6-00', 'Z67P', 'ZH7C',
    ];

    #[DataProvider('yamlTestSuiteProvider')]
    public function testYamlTestSuite(string $testName, string $shortcode, string $dir, bool $isError, mixed $expected)
    {
        if (\in_array($shortcode, self::$skip, true)) {
            $this->markTestSkipped('Test case "'.$testName.'" ('.$shortcode.') is skipped.');
        }

        $file = $dir.\DIRECTORY_SEPARATOR.'in.yaml';

        $isErrorExpected = false;
        if ($isError) {
            $isErrorExpected = true;
            $this->expectException(\Exception::class);
        }

        $yaml = Yaml::parseFile($file);

        if (!$isErrorExpected) {
            $this->assertEquals($expected, $yaml, 'Test case "'.$testName.'" ('.$shortcode.') failed.');
        }
    }

    public static function yamlTestSuiteProvider(): array
    {
        if (!file_exists(__DIR__.\DIRECTORY_SEPARATOR.'yaml-test-suite')) {
            self::markTestSkipped('The YAML test suite is not available.');
        }

        $dataDir = __DIR__.\DIRECTORY_SEPARATOR.'yaml-test-suite';
        $shortcodeDirs = glob($dataDir.\DIRECTORY_SEPARATOR.'*', \GLOB_ONLYDIR);

        $testDirs = [];
        foreach ($shortcodeDirs as $shortcodeDir) {
            $shortcode = basename($shortcodeDir);

            // ignore metadata directories referencing other test cases by name
            if (\in_array($shortcode, ['name', 'tags'], true)) {
                continue;

Review comment (suggestion):
It must expect `ParseException` of the component, not any exception.

Code after:
        '2JQS',
        '2LFX',
        '2SXE',
        '2XXW',
        '33X3',
        '35KP',
        '36F6',
        '4ABK',
        '4FJ6',
        '4JVG',
        '4RWC',
        '565N',
        '57H4',
        '5LLU',
        '5TRB',
        '5TYM',
        '5U3A',
        '5WE3',
        '6BFJ',
        '6CA3',
        '6CK3',
        '6JWB',
        '6LVF',
        '6M2F',
        '6VJK',
        '6WLZ',
        '6XDY',
        '6ZKB',
        '735Y',
        '74H7',
        '7FWL',
        '7T8X',
        '7W2P',
        '7Z25',
        '87E4',
        '8G76',
        '93JH',
        '98YD',
        '9BXH',
        '9C9N',
        '9DXL',
        '9JBA',
        '9KAX',
        '9MAG',
        '9MMA',
        '9MMW',
        '9MQT-01',
        '9WXW',
        '9YRD',
        'A2M4',
        'AVM7',