annotationExtractor = new AnnotationExtractor(); } /** * @dataProvider extractAnnotationProvider() */ public function testExtractAnnotationFromClass(string $className, string $annotation, ?string $expected): void { $value = $this->annotationExtractor->extractAnnotationFromClass($className, $annotation); $this->assertSame($expected, $value); } public function extractAnnotationProvider(): Iterator { yield 'Class with changelog annotation' => [ RectorWithChangelog::class, '@changelog', 'https://github.com/rectorphp/rector/blob/master/docs/rector_rules_overview.md', ]; yield 'Class without changelog annotation' => [RectorWithOutChangelog::class, '@changelog', null]; } }